gpt4 book ai didi

iphone - MFMailComposeViewController 崩溃

转载 作者:行者123 更新时间:2023-12-03 19:59:23 29 4
gpt4 key购买 nike

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 根本不喜欢这样。

最佳答案

正如提问者报告的那样,MFMailComposeViewController 使用了一些不应分类的 native 元素。因此,您必须确保 UITextFieldUITextView 等元素上没有任何类别。

关于iphone - MFMailComposeViewController 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6320590/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com