0
發送郵件隨着Attachement我已創建程序EXC_BAD_ACCESS在iPhone
它,如果我不使用連接工作正常與我的一些細節,從SQLite數據庫發送郵件,但如果我取消,像即時得到異常喜歡這個:
Thread 1: EXC_BAD_ACCESS(code=1, address=0x474e5091
這裏是我的代碼:
MFMailComposeViewController *mailView = [[MFMailComposeViewController alloc] init];
mailView.mailComposeDelegate = (id) self;
NSArray *recipients = [NSArray arrayWithObject:@"[email protected]"];
[mailView setToRecipients:recipients];
[mailView setSubject:@"Try Mail From User Application"];
NSString *body = [[NSString alloc] initWithFormat:@"First Name : %@ <br>",lblFirstName.text];
body = [body stringByAppendingFormat:@"Last Name : %@<br>",lblLastName.text];
body = [body stringByAppendingFormat:@"Username : %@<br>",lblUsername.text];
body = [body stringByAppendingFormat:@"Password : %@<br>",lblPassword.text];
body = [body stringByAppendingFormat:@"Birthdate : %@<br>",lblBD.text];
[mailView addAttachmentData:[UIImagePNGRepresentation(u.Img1) bytes]
mimeType:@"image/png"
fileName:@"a.png"];
[mailView setMessageBody:body isHTML:YES];
[self presentModalViewController:mailView animated:YES];
我米數據庫獲取正確的數據和即時通訊能夠在屏幕上顯示的圖像,但問題是隻磨片NI附加圖像在
UIImagePNGRepresentation(u.Img1)
U是用戶類的目的郵件
這裏(用戶定義類)和IMG1是UIImage的
的對象
感謝它正在完美地工作。 – CRDave