0
我有这段代码MFMailComposer
在模拟器和iPhone 4中正常工作,但它崩溃在3GS。什么是解决它的原因和解决方法?MFMailComposer不能在iPhone 3GS
我用断点检查了它。 mailPicker
未分配内存。
MFMailComposeViewController *mailPicker = [[MFMailComposeViewController alloc] init];
mailPicker.mailComposeDelegate = self;
// Set the subject of email
[mailPicker setSubject:@"Somebody got place in my sh*t list"];
NSString *emailBody = @"I just added somebody to my s**t list";
// This is not an HTML formatted email
[mailPicker setMessageBody:emailBody isHTML:NO];
// Create NSData object as PNG image data from camera image
NSData *data = UIImagePNGRepresentation([self captureScreen]);
// Attach image data to the email
// 'CameraImage.png' is the file name that will be attached to the email
[mailPicker addAttachmentData:data mimeType:@"image/png" fileName:@"CameraImage"];
// Show email view
[self presentModalViewController:mailPicker animated:YES];
// Release picker
[mailPicker release];
关于您在3GS上的崩溃 - 如果您可以提供一些关于崩溃和控制台中的任何错误代码/日志的更多信息,那么这将有所帮助。 – Luke 2011-06-04 19:46:02