tags:

views:

489

answers:

1

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?

A: 

Hope this link helps You.This explains to display the activity indicator for parsing action of the rss feed.

All the best.

Warrior
kind of. But I need to start the activity indicator in the didSelectRowAtIndexPath method. I load it with top level rows, then when one is selected it goes off and loads my JSON feed for the selected row which take 2 - 3 seconds to do. Thanks
Frames84