I had the same problem and I finally found the cause of the problem.
It seems that [UILabel setTextColor:] crashes (only!) IOS 4.x when null color is passed as a parameter. My app works great on iOS 5 and 6.
I use a navigationBar created with IB that has a UITextField in it (which, as usual, is a subquery of BarButtonItem). This TextField had the TextColor attribute left to it by default. For TextFields that fit into a regular view, this works fine, but not for my TextField in the navigationBar. As soon as I changed TextColor to something else (for example, Dark Text Color), it works fine and does not cause further failure.
It was difficult to identify this problem, as it happens when the application starts, and by the time all the NIB files were loaded, therefore, debugging of codes or exception checkpoints did not work. Even the crash log did not help, as it simply tells you that this happens when the NIB file is downloaded, but does not tell you which one. In my case, a lot of views are loaded at startup. Finally, I was able to track down the problem by creating a class of the UILabel Class class and simply adding the -(void )setTextColor:(UIColor *)color method to this category. In this method, I was able to set a breakpoint and found that the parameter was zero in only one case. In addition, I added -(void )setText:(NSString *)text and looked at what text was set for this particular UILabel, where nil was previously set. The text parameter finally pointed to my UITextField in the navigationBar.
Perhaps this helps in other cases where this failure is not related to the UITextField in the UINavigationBar.
source share