Спасибо! Мой индикатор работает сейчас.
Я поделюсь примером кода для собратьев по нубу, чтобы выразить это в контексте.
- (void) viewDidLoad
// custom button images
UIImage *customImage = [UIImage imageNamed:@"menu24"];
UIImage *customImage2 = [UIImage imageNamed:@"search24"];
UIImage *customImage3 = [UIImage imageNamed:@"back24"];
// These are linked in my story board to Navigation Item
[self customiseBarBtnItem:[self menu_button]
customImage:customImage selector:@selector(menuPressed:)];
[self customiseBarBtnItem:[self search_button]
customImage:customImage2 selector:@selector(searchPressed:)];
[self customiseBarBtnItem:[self backButton]
customImage:customImage3 selector:@selector(backPressed:)];
//initialize the activity indicator - as @antf comment suggests for ios7
UIActivityIndicatorView *actInd=[[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
//store it as a property on the view controller
self.activityIndicator = actInd;
// this sets up activity indicator
UIBarButtonItem *progress_indicator = [[UIBarButtonItem alloc]
initWithCustomView:[self activityIndicator]];
// link custom buttons AND activity indicator in desired order to navigation bar
self.navigationItem.rightBarButtonItems =
[NSArray arrayWithObjects:
self.menu_button,
self.search_button,
progress_indicator,
nil];
// Для полноты - так я программно показываю / скрываю кнопку возврата
if ( bShowBack == YES )
self.navItemBar.leftBarButtonItem = self.backButton;
else
self.navItemBar.leftBarButtonItem = Nil;
// Я использую свой индикатор активности с UIWebView, поэтому запускаю его следующим образом
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[[self activityIndicator] startAnimating];
}
- (void)didFailLoadWithError:(UIWebView *)webView
didFailLoadWithError:(NSError *)error
{
[[self activityIndicator] stopAnimating];
}
- (void)webViewDidFinishLoad:(UIWebView *) webView
{
[[self activityIndicator] stopAnimating];
}