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