MFMailComposeViewController崩溃
|
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setSubject:@\"Support Enquiry\"];
[mailViewController setToRecipients:[NSArray arrayWithObject:EMAIL_SUPPORT]];
[self presentModalViewController:mailViewController animated:YES];
[mailViewController release];
}
我的代码在
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
符合:
*** Terminating app due to uncaught exception \'CALayerInvalidGeometry\',
reason: \'CALayer position contains NaN: [nan 24.5]\'
*** Call stack at first throw:
(
0 CoreFoundation 0x011f75a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0134b313 objc_exception_throw + 44
2 CoreFoundation 0x011afef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x011afe6a +[NSException raise:format:] + 58
4 QuartzCore 0x00145ba2 _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177
5 QuartzCore 0x00145d55 -[CALayer setPosition:] + 42
6 QuartzCore 0x0013e24d -[CALayer setFrame:] + 763
7 UIKit 0x0047eda2 -[UIView(Geometry) setFrame:] + 255
8 UIKit 0x004ea660 -[UITextField setFrame:] + 166
9 MessageUI 0x001faa48 -[_MFComposeRecipientView reflow] + 3371
10 MessageUI 0x001f9678 -[_MFComposeRecipientView setLabel:] + 79
11 MessageUI 0x001ff144 -[MFMailComposeView _setupField:withLabel:navTitle:property:changingView:toSize:fieldFrame:visible:] + 234
12 MessageUI 0x00203277 -[MFMailComposeView _layoutSubviews:changingView:toSize:searchResultsWereDismissed:] + 1768
13 MessageUI 0x001fea6f -[MFMailComposeView _layoutSubviews:changingView:toSize:] + 71
14 MessageUI 0x001fea22 -[MFMailComposeView _layoutSubviews:] + 69
15 MessageUI 0x00200859 -[MFMailComposeView initWithFrame:navigationItem:options:delegate:] + 2175
16 MessageUI 0x00215ea6 -[MFMailComposeController initializeUI] + 228
17 MessageUI 0x0021cfb9 -[MFMailComposeController initForContentSize:navigationItem:options:] + 147
18 MessageUI 0x00236267 -[MFMailComposeRootViewController initWithCompositionContext:contentSize:mailComposeControllerOptions:] + 377
19 MessageUI 0x0022fbe7 -[MFMailComposeViewController initWithComposition:contentSize:mailComposeControllerOptions:] + 726
20 MessageUI 0x0022f634 -[MFMailComposeViewController initWithComposition:] + 68
21 MessageUI 0x0022f71e -[MFMailComposeViewController initWithNibName:bundle:] + 98
...
知道发生了什么吗?
编辑:到目前为止所有答案都没有做任何事情,它仍然崩溃:(
编辑2:我终于弄清楚了问题-我已经在文本字段中添加了一个类别,而MFMailComposeViewController根本不喜欢该类别。
没有找到相关结果
已邀请:
9 个回复
屑凉赦
或ѭ5are中没有任何类别。
扇献隙
类的
字段有疑问。 可能是,您正在发送\“ To Recipient \”字符串数组,其中没有有效的
对象,iOS内部在internal6 try字段中尝试使用try9ѭ计算字符串的高度。 只是建议您通过替换以下语句来测试上述假设。
用
让我知道它是否再次因相同的消息而崩溃。 编辑: UITableView崩溃给出了“ CALayerInvalidGeometry”,原因:“ CALayer位置包含NaN:[160 nan]”
届甸衬丝蚕
靛新比比催
死搭胯
队辅坟阮阶
鲁釜头
辰炔诚薯
但是您可以添加以下类别以自定义文本字段:
我认为这会对您有所帮助。
款去芳尾脊