MFMailComposeViewController throws an error only in iOS 9

后端 未结 5 1635
一生所求
一生所求 2020-12-15 18:33

I can\'t get MFMailComposeViewController to open without throwing a fatal error in iOS 9 Simulator.

The same code (Objective C) works flawlessly in iOS 8.x and lower

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 19:16

    I have no idea why it happens or how did I discovered it, the crash seems to be generated by setting the NSFontAttributeName in the Appearance proxy for the navigation bar, if I uncomment that line the app crashes.

        NSDictionary* format = @{
                             NSForegroundColorAttributeName:[UIColor whiteColor],
                             //NSFontAttributeName: [UIFont boldSystemFontOfSize:20],
                             };
    
    [[UINavigationBar appearance] setTitleTextAttributes:format];
    

    Please @Sleiman try and see if this fixes the issue for you too.

提交回复
热议问题