Tôi muốn có thể sử dụng iPhone Mail.app bên trong ứng dụng của mình để người dùng của tôi có thể gửi email chia sẻ mà không phải rời khỏi ứng dụng. Tôi biết 3.0 đã làm được điều này.iPhone - MessageUI - khung không tìm thấy Tin nhắn
Tôi đã thêm khung đúng cách bằng cách nhấp vào thư mục khung của tôi -> thêm khung hiện có.
gia tăng này đến tập tin tiêu đề của viewController Tôi muốn Mail.app xuất hiện trong.
#import <MessageUI/MessageUI.h>
tôi bật lên một UIAlert và bế mạc Tôi gọi hàm dưới đây, Không có lỗi hiển thị trong mã của tôi. Tôi có phải làm gì đó bên trong Trình tạo giao diện không? Lỗi Msg là Dưới
-(void)showEmailModalView {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self; // <- very important step if you want feedbacks on what the user did with your email sheet
NSString * emailSubject = [[NSString alloc] initWithFormat:@"iPhone Subject Test"];
[picker setSubject:emailSubject];
NSString * content = [[NSString alloc] initWithFormat:@"iPhone Email Content"];
// Fill out the email body text
NSString *pageLink = @"http://mugunthkumar.com/mygreatapp"; // replace it with yours
NSString *iTunesLink = @"http://link-to-mygreatapp"; // replate it with yours
NSString *emailBody =
[NSString stringWithFormat:@"%@\n\n<h3>Sent from <a href = '%@'>MyGreatApp</a> on iPhone. <a href = '%@'>Download</a> yours from AppStore now!</h3>", content, pageLink, iTunesLink];
[picker setMessageBody:emailBody isHTML:YES]; // depends. Mostly YES, unless you want to send it as plain text (boring)
picker.navigationBar.barStyle = UIBarStyleBlack; // choose your style, unfortunately, Translucent colors behave quirky.
[self presentModalViewController:picker animated:YES];
[picker release];
[content release];
[emailSubject release];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[self dismissModalViewControllerAnimated:YES];
}
LỖI THÔNG ĐIỆP của tôi:
ld: framework not found Message
collect2: ld returned 1 exit status
Tôi đi theo hướng dẫn này: http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/
Xem http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4 – Stan