Tôi mới phát triển ứng dụng ios, Dưới đây là mã tôi đã sử dụng để gửi email.Không thể gửi email bằng MFMailComposeViewController trong trình mô phỏng
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"My Subject"];
[controller setMessageBody:@"Hello there." isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error {
if (result == MFMailComposeResultSent) {
NSLog(@"It's away!");
}
[self dismissModalViewControllerAnimated:YES];
}
Rất tiếc, các phương thức ủy quyền sẽ không bao giờ được kích hoạt, Có thể bất kỳ ai đề xuất cách tôi có thể kiểm tra email của mình qua trình mô phỏng không?
tôi đã phải đối mặt với problem..but cùng khi tôi đã cố gắng trên điện thoại của tôi nó làm việc tốt .. nhờ lukya cho lời giải thích. –
Đối với nhiệm vụ của tôi, tôi chỉ cần hiển thị nhà soạn nhạc. Nhưng tôi không thể làm như vậy. MFMailComposeViewController * composeVC = [[MFMailComposeViewController alloc] init]; . Dòng này bật lên bộ điều khiển cảnh báo –