I have a simple problem:
If i click on my mail button and there is no E-Mail address deposited i want the alertView to show up and i don`t want it to go to the Mail composer but it does.
The AlertView works but why does it goe to the MailComposer anyway?
Using X-Code, Objective C.
Here is the Code:
-(IBAction)sendMail {
if ([mailIdentity isEqualToString:@""] == FALSE); {
MFMailComposeViewController *mailController0 = [[MFMailComposeViewController alloc]init];
[mailController0 setMailComposeDelegate:self];
NSString *email0 = mailIdentity;
NSArray *emailArray0 = [[NSArray alloc] initWithObjects:email0, nil];
[mailController0 setToRecipients:emailArray0];
[mailController0 setSubject:@"From my IPhone"];
[self presentViewController : mailController0 animated:YES completion:nil];
}
if ([mailIdentity isEqualToString:@""] == TRUE) {
UIAlertView *noMail = [[UIAlertView alloc] initWithTitle: @"noMail"
message: @"No E-Mail address"
delegate: nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[noMail show];
}
}
Thanks for the help.