I have an app in the app store where I use Flurry analytics. And from time to time I get an unhandled exception error that I cannot understand.
NSInvalidArgumentException: - [UIBarButtonItem setTintColor:]: unrecognized selector sent to instance 0x177b20 Msg: application is broken
What I can not understand, I do not install anywhere at any time. I have several custom views in which I set the right panel button element, but there are no shades.
Most of my button buttons look like this.
- (void)viewDidLoad { [super viewDidLoad]; UINavigationBar *bar = [self.navigationController navigationBar]; [bar setTintColor:[UIColor colorWithRed:0 green:69.0/255 blue:118.0/255 alpha:1]]; self.navigationItem.title = @"Edit User"; UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(editUser:)]; self.navigationItem.rightBarButtonItem = saveButton; [saveButton release]; UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; [[self navigationItem] setLeftBarButtonItem:cancelButton]; [cancelButton release]; }
If anyone understands this problem, I will be very grateful. I am targeting iOS 4.0 and in my project.
UPDATE: I figured out what causes some random issues in setTintColor. I found that I was setting the hue color on one of the panel elements. I assume that there are some differences between OS versions that can lead to crashes. Therefore, if someone can tell me a neutral OS way to set a custom right-hand button in my navigation bar, this will be appreciated.
source share