Reputation: 1105
I am writing an iPad app and want to put an option on the home screen (root view controller) to allow users to e-mail feedback. I would like the mail to appear with the style "UIModalPresentationFormSheet". However, when I run the code, it appears full screen. What am I doing wrong? Here is the code I am using:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSArray *toAddresses = [[NSArray alloc] initWithObjects:@"[email protected]", nil];
[picker setToRecipients:toAddresses];
[toAddresses release];
[picker setSubject:@"App Feedback"];
self.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:picker animated:YES];
[picker release];
Upvotes: 0
Views: 453
Reputation: 5291
You need to set modalPresentationStyle on your new view controller, not self.
Upvotes: 2
Reputation: 22395
You must set the style of the viewController being presented, not on the one presenting it.. So set the property of the MFMailComposeViewController and you should be ok.
Upvotes: 2