
Hi, I'm receiving the following error ... while sending mail in my iphone application
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[viewController keyboardWasShown:]: unrecognized selector sent to instance 0x1baa20'
any idea .. why i'm getting this error and to solve it?
Thanks in Advance!

Hi all, I get it done myself... actually in my send mail code i have predefined the mailto id as well as cc and bcc.. and was changing it at the run time that was giving me the NSInvalidArgumentException. Now as i have changed and left it blank to enter the mail to id at runtime it is working perfectly.
Previous Code:
-(void)displayComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello from California!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"first@example.com"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com", @"third@example.com", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"fourth@example.com"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"rainy"];
// Fill out the email body text
NSString *emailBody = @"It is raining in sunny California!";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
}
Now, Set up recipients is left blank in the new code. that works fine. Thanks!
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.