self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor];
Here i am setting the blue color for the rightbarbuttom item it works in ios5 but not in ios4. How should i prevent the crash so that my app supports both ios4 and ios5.
yes, @borrrden is correct, setting tintColor
for UIBarButtonItem
is available only after iOS 5.0
. Check the condition before you set color to your navigationItem
#if __IPHONE_5_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
self.navigationItem.rightBarButtonItem.tintColor = [UIColor blackColor];
#endif
You should stop using appearance
and UIBarButtonItem
's tintColor
because they are not supported on iOS 4.x