Extremely slow MFMailComposeViewControllerDelegate
Posted
by Jeff B
on Stack Overflow
See other posts from Stack Overflow
or by Jeff B
Published on 2010-04-04T05:02:07Z
Indexed on
2010/04/04
5:03 UTC
Read the original article
Hit count: 481
I have a bit of a strange problem. I am trying to send in-app email. I am also using Cocos2d. It works, so far as I get the mail window and I can send mail, but it is extremely slow. It seems to only accept touches every second or so. I checked the cpu usage, and it is quite low. I paused my director, so nothing else should be happening. Any ideas? I am pulling my hair out.
I looked at some examples and did the following:
Made my scene the mail delegate:
@interface MyLayer : CCLayer <MFMailComposeViewControllerDelegate> {
...
}
And implemented the following function in the scenes:
-(void) showEmailWindow: (id) sender {
[[CCDirector sharedDirector] pause];
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject: @"My subject here"];
NSString *emailBody = @"<h1>Here is my email!</h1>";
[picker setMessageBody:emailBody isHTML:YES];
[myMail presentModalViewController:picker animated:NO];
[picker release];
}
I also implemented the mailComposeController, to handle the callback.
© Stack Overflow or respective owner