Je souhaite pouvoir utiliser l'application Mail.app de l'iPhone au sein de mon application afin que mes utilisateurs puissent envoyer un courriel partagé sans quitter l'application. Je sais que 3.0 a rendu cela possible.iPhone - MessageUI - cadre introuvable Message
J'ai ajouté le framework correctement en cliquant sur mon dossier frameworks -> ajouter un framework existant.
a ajouté au fichier d'en-tête de la viewcontroller Je veux que Mail.app apparaisse dans.
#import <MessageUI/MessageUI.h>
je pop un UIAlert et à la fermeture que j'appelle la fonction ci-dessous, il n'y a pas d'erreurs Révéler dans mon code. Dois-je faire quelque chose de plus à l'intérieur de l'Interface Builder? Message d'erreur Ci-dessous
-(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];
}
Mon message d'erreur:
ld: framework not found Message
collect2: ld returned 1 exit status
J'ai suivi ce tutoriel: http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/
Voir http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4 – Stan