iPhone xcode - Activity Indicator with tab bar controller and multi table view controllers

Posted by Frames84 on Stack Overflow See other posts from Stack Overflow or by Frames84
Published on 2010-04-20T09:34:16Z Indexed on 2012/11/08 11:03 UTC
Read the original article Hit count: 239

I've looked for a tutorial and can't seem to find one for a activity indicator in a table view nav bar. in my mainWindow.xib I have a Tab Bar Controller with 4 Tabs controllers each containing a table view. each load JSON feeds using the framework hosted at Google.

In one of my View Controller I can add an activity indicator to the nav bar by using:

UIActivityIndicatorView *activityIndcator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0,0,20,20)];
[activityIndcator startAnimating];
UIBarButtonItem *activityItem = [[UIBarButtonItem alloc] initWithCustomView:activityIndcator];
self.navigationItem.rightBarButtonItem = activityItem;

however and can turn it off by using:

self.navigationItem.rightBarButtonItem.enabled = FALSE;

But if i place this in my viewDidLoad event it shows all the time. I only want it to show when I select a row in my table view. so I added it at the top of didSelectRowAtIndexPath and the stop line after I load a feed. it shows but takes a second or two and only shows for about half a second.

is the an event that firers before the didSelectRowAtIndexPath event a type of loading event? if not what is the standard menthord for implementing such functionality?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios