Permalink
Browse files

Fixed new loading additions, we are not working with ARC in PSFoundat…

…ion :)
  • Loading branch information...
1 parent 4b4835c commit 037fe141c7da57dd7241ed3f80b890c3894a947e @myell0w myell0w committed Sep 20, 2011
View
@@ -14,7 +14,7 @@ @interface UITableView ()
@implementation UITableView (FKLoading)
- (void)showLoadingIndicatorAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = [self.dataSource tableView:self cellForRowAtIndexPath:indexPath];
+ UITableViewCell *cell = [self cellForRowAtIndexPath:indexPath];
if (!self.allowsMultipleLoadingIndicators) {
[self hideLoadingIndicators];
@@ -25,7 +25,7 @@ - (void)showLoadingIndicatorAtIndexPath:(NSIndexPath *)indexPath {
}
- (void)hideLoadingIndicatorAtIndexPath:(NSIndexPath *)indexPath {
- UITableViewCell *cell = [self.dataSource tableView:self cellForRowAtIndexPath:indexPath];
+ UITableViewCell *cell = [self cellForRowAtIndexPath:indexPath];
[cell hideLoadingIndicator];
[self.cellsShowingLoadingIndicator removeObject:indexPath];
@@ -4,7 +4,7 @@
@interface UITableViewCell (FKLoading)
-@property (nonatomic, strong, readonly) UIActivityIndicatorView *activityView;
+@property (nonatomic, retain, readonly) UIActivityIndicatorView *activityView;
- (void)showLoadingIndicator;
- (void)hideLoadingIndicator;
@@ -7,8 +7,8 @@
@interface UITableViewCell ()
// re-define as read/write
-@property (nonatomic, strong, readwrite) UIActivityIndicatorView *activityView;
-@property (nonatomic, strong) UIView *previousAccessory;
+@property (nonatomic, retain, readwrite) UIActivityIndicatorView *activityView;
+@property (nonatomic, retain) UIView *previousAccessory;
@end
@@ -23,10 +23,12 @@ - (void)showLoadingIndicator {
self.previousAccessory = self.accessoryView;
// set activityIndicator as new accessoryView
- self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
+ self.activityView = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
[self.activityView startAnimating];
+ self.accessoryType = UITableViewCellAccessoryNone;
self.accessoryView = self.activityView;
+ [self setNeedsDisplay];
}
- (void)hideLoadingIndicator {
@@ -4,7 +4,7 @@
@interface UIViewController (FKLoading)
-@property (nonatomic, strong, readonly) UIActivityIndicatorView *activityView;
+@property (nonatomic, retain, readonly) UIActivityIndicatorView *activityView;
- (void)showCenteredLoadingIndicator;
- (void)showLoadingIndicatorInsteadOfView:(UIView *)viewToReplace;
@@ -11,8 +11,8 @@
@interface UIViewController ()
-@property (nonatomic, strong, readwrite) UIActivityIndicatorView *activityView;
-@property (nonatomic, strong) id replacedObject;
+@property (nonatomic, retain, readwrite) UIActivityIndicatorView *activityView;
+@property (nonatomic, retain) id replacedObject;
@end
@@ -27,7 +27,7 @@ - (UIActivityIndicatorView *)activityView {
// create activityView when it is first read
if (activityView == nil) {
- activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+ activityView = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge] autorelease];
self.activityView = activityView;
}
@@ -83,7 +83,7 @@ - (void)showLoadingIndicatorInNavigationBar {
// initing the loading view
UIActivityIndicatorView *activityView = self.activityView;
- UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, 24.f, 26.f)];
+ UIView *backgroundView = [[[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, 24.f, 26.f)] autorelease];
UIBarButtonItem *barButtonItemToReplace = self.navigationItem.rightBarButtonItem;
activityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
@@ -92,7 +92,7 @@ - (void)showLoadingIndicatorInNavigationBar {
[backgroundView addSubview:activityView];
self.replacedObject = barButtonItemToReplace;
- self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backgroundView];
+ self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:backgroundView] autorelease];
[activityView startAnimating];
}

0 comments on commit 037fe14

Please sign in to comment.