MFMailComposeViewController Crashes because of Global Appearance Properties on iOS6

我们两清 提交于 2019-11-27 14:46:55

Try using UITextAttributeTextColor instead of NSForegroundColorAttributeName.

Just extends UINavigationController class

@interface MyNavigationController : UINavigationController
@end

replace all your UINavigationController class with the new subclass and [appearanceWhenContainedIn:] in your app delegate

[UINavigationBar appearanceWhenContainedIn:[MyNavigationController class], nil].titleTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor] };

after that your app will not crash.

paulrehkugler

The only way I was able to solve this was to create [[UINavigationBar appearanceWhenContainedIn:] setTitleTextAttributes:] for each of my UIViewControllers. Luckily this was fairly simple, because all of my custom view controllers come from 4 view controller subclasses.

Edit: see this answer because I'm dumb.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!