我想为所有导航栏设置一致的标题颜色:
NSDictionary *titleAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],
NSFontAttributeName: MY_FONT_HERE};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
这段代码在 iOS6 中工作,但在 ios7 中崩溃。
崩溃消息很奇怪:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [__NSCFConstantString pointSize]: unrecognized selector sent to instance 0x107c34'