Hallo alle miteinander, ich hoffe jemand kann mir helfen.
Also erstmal zum Anfang ich bin relativer Neuling in der Entwicklung mit iDevices.
Ich habe vor kurzen eine Iphone App entwickelt.
Diese hatte eine E-Mail Funktion, welche auch jetzt noch top funktioniert.
Ich wollte diese App dann noch für das iPad entwickeln und bin fast fertig.
Allerdings mit einem kleinen Problem.
wenn ich in der iPad-Mail Funktion auf Abbrechen oder Senden drücke , fährt die Mail nicht automatisch wieder runter und zeigt mir mein View an.
Es passiert einfach garnix.
Der Code is folgendermaßen:
// Email Subject
NSString *emailTitle = @"Pix Fix";
// Email Content
NSArray *toRecipents = [NSArray arrayWithObject:@"timtraumer@yahoo.de"];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:emailTitle];
[mc setToRecipients:toRecipents];
// Present mail view
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
Also erstmal zum Anfang ich bin relativer Neuling in der Entwicklung mit iDevices.
Ich habe vor kurzen eine Iphone App entwickelt.
Diese hatte eine E-Mail Funktion, welche auch jetzt noch top funktioniert.
Ich wollte diese App dann noch für das iPad entwickeln und bin fast fertig.
Allerdings mit einem kleinen Problem.
wenn ich in der iPad-Mail Funktion auf Abbrechen oder Senden drücke , fährt die Mail nicht automatisch wieder runter und zeigt mir mein View an.
Es passiert einfach garnix.
Der Code is folgendermaßen:
// Email Subject
NSString *emailTitle = @"Pix Fix";
// Email Content
NSArray *toRecipents = [NSArray arrayWithObject:@"timtraumer@yahoo.de"];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:emailTitle];
[mc setToRecipients:toRecipents];
// Present mail view
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail sent failure: %@", [error localizedDescription]);
break;
default:
break;
}
// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von John1994 ()