3

I would like to add an UIActivityIndicatorView (_av object) object into a left bar button item of UINavigationItem

My code looks like :

UIBarButtonItem * button = [[UIBarButtonItem alloc] initWithCustomView:_av];
[self.navigationItem setLeftBarButtonItem:button];
[button release];

but after I launch the code I take an error:

*** Assertion failure in -[UINavigationBar layoutSublayersOfLayer:],    /SourceCache/UIKit/UIKit-2380.17/UIView.m:5776

2013-04-15 16:28:39.246 * [12484:907] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UINavigationBar's implementation of -layoutSubviews needs to call super.'

How I should to implement it correctly ?

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93

0 Answers0