I've seen several questions before such as this but for the lack of an accepted answer as well as having implemented everything as needed I still continue to face the issue as follows:
I display the mail composer but on clicking cancel, the composer view freezes. I think this is due to the Save/Delete draft action sheet showing up out of the visible frame. Yes I have set the mailComposeDelegate to the presenting view controller and have read up on several similar questions where user's have not handled the (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
delegate to dismiss the composer on cancel. I have handled that as well but I cant seem to figure out for the life of me why the action sheet wont show up in the visible area of the screen in the iPhone version of my universal app. The view frame of the viewcontroller modally presenting the mail composer as NSLogged is (0,0,320,480). My app is universal & the mail composer works perfectly on the iPad. Below is a screenshot of how the composer view looks, running on iPhone Simulator 5.1:-
Here's the code to display the composer:
-(IBAction)mailButtonPressed:(id)sender {
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"Subject"];
[controller setMessageBody:@"Test" isHTML:YES];
[controller setToRecipients:nil];
if(controller) {
[self presentModalViewController:controller animated:YES];
[controller release];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error
{
[self dismissModalViewControllerAnimated:YES];
}
po [[UIApp keyWindow] recursiveDescription]
. Copy the output and paste it into your question. – Snailfishmailer.delegate = self;
instead ofmailer.mailComposeDelegate = self;
and did indeed have the wrong delegate definition. Now the code behaves perfectly normally on both these iPhones. No dimmed views; everything dismisses as expected. I started trying with an iPhone app, and that was normal. I switched it to a universal app running on iPhones, and that was normal too. – Effectuateapplication:didFinishLaunchingWithOptions:
withself.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
– MacarioUIActionSheet
method? Is there any chance your code thinks the device is iPad and try to pop the action sheet even when it is an iPhone? – Gardel