So right now, I have a right bar button in storyboard hooked up with a segue to another view controller. All the functions work fine here. (without code, all done through storyboard)
Now, I'm connecting to a webAPI call to see if the image needs to be changed. I have the code below:
if ( json.count == 0) {
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"notification.png"]]];
}
else
{
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"notification-new.png"]]];
}
So this all work fine and the image does change if there are more than 1 json data received. However, the button itself does not push to the new view controller