I have taken the MailComposer example added to a simple project and under a button I am executing the following code:
// display in app email
MailComposerViewController *emailClient = [[MailComposerViewController alloc] init];
[self.view addSubview:emailClient.view];
[emailClient showPicker:self];
[emailClient release];
Last line is give me headache. If I don't put that like I create a memory leak, if I add that line the mail client shows up but then the app hangs when I click cancel or send. With the memory leak (aka no last line) everything works fine.
What is the best way in a very well know case like this? I want to create an option in the same method and that object has delegates and such. It's not worth to have that object alive for the entire life of the app.
Thanks, amok