Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 03-17-2011, 08:02 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 3
tomasita is on a distinguished road
Default Problem displaying MFMailComposeViewController modal view

Hi,

I'm having problems displaying a modal view for sending emails (MFMailComposeViewController). I'm trying to display this modal view from a detailed view that was pushed on the stack by selecting a cell in an initial table view. I think I probably have some mess with the navigation stacks,as I do not fully understand it. My problem is that although the MFMailComposeViewController does display, I do not get the Send and Cancel buttons that I usually go with the MFMailComposeViewController view. I just get the 'Back' button of my detail view in my navigation bar.


My detail view is a subclass of UIViewController conforming to MFMailComposeViewControllerDelegate and UINavigationControllerDelegate protocols:



And my methods for sending emails is:

-(void)sendEmail {

MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate = self;


if ([MFMailComposeViewController canSendMail]) {


[mailComposer setToRecipients:[NSArray arrayWithObjects:@"test@gmail.com",nil]];
[mailComposer setSubject:@"Subjecy"];
[mailComposer setMessageBody:@"Body" isHTML:NO];



[self presentModalViewController:mailComposer animated:YES];
}


[mailComposer release];

}

- (void)mailComposeControllerMFMailComposeViewCont roller*)controller didFinishWithResultMFMailComposeResult)result errorNSError*)error
{
[self dismissModalViewControllerAnimated:YES];

if (result == MFMailComposeResultFailed) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Failed" message:@"Your message failed to send" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
}


Many thanks for any help.
tomasita is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 405
18 members and 387 guests
Brandt, coolman, Domele, Droverson, Duncan C, fredidf, Free App Monster, givensur, iAppDeveloper, locombiano89, Mah6447, MasterX, Meoz, simplymuzik3, SLIC, stanny, stevenkik, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,864
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:56 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0