objective c - Weird MFMailComposeViewController Crash -


following lines crashing on ipad. using xcode 4.6.3 (4h1503) 6.0 target os platform. used work fine!

if ([mfmailcomposeviewcontroller cansendmail]) {     mfmailcomposeviewcontroller *mailviewcontroller = [[mfmailcomposeviewcontroller alloc] init];     [self presentviewcontroller:mailviewcontroller animated:yes completion:nil]; } 

with following exceptions:

2013-09-04 02:30:47.489 myproject[38633:5b0b] * assertion failure in nsdictionary *_uirecordargumentofinvocationatindex(nsinvocation *, nsuinteger, bool)(), /sourcecache/uikit_sim/uikit-2380.17/uiappearance.m:1118

2013-09-04 02:31:00.816 myproject[38633:5b0b] * terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'unknown key, "{size = 13.000000, traits = 00000000}" in title text attributes dictionary'

edit: crashing due following lines. guess why? never thought mfmailcomposeviewcontroller have relation uitabbaritem ...

nsdictionary *textattributesdict = @{ [uicolor whitecolor] : uitextattributetextcolor,                                           [uifont systemfontofsize:13.0f] : uitextattributefont};  [[uitabbaritem appearance] settitletextattributes:textattributesdict forstate:uicontrolstateselected]; [[uitabbaritem appearance] settitletextattributes:textattributesdict forstate:uicontrolstatenormal]`; 

the nsdictionary had key/value reversed. supposed have key:value instead of value:key

nsdictionary *textattributesdict = @{ [uicolor whitecolor] : uitextattributetextcolor,                                           [uifont systemfontofsize:13.0f] : uitextattributefont}; 

changing above following worked. desdenova pointer.

nsdictionary *textattributesdict = @{uitextattributetextcolor : [uicolor whitecolor],                                           uitextattributefont : [uifont systemfontofsize:13.0f]}; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -