Reputation: 21593
if([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
controller.body = @"This is a test!";
controller.recipients = [NSArray arrayWithObject:phones];
controller.messageComposeDelegate = self;
[self presentViewController:controller animated:YES completion:nil];
}
This code makes the entire screen white/blank. Any suggestions?
Upvotes: 3
Views: 1813
Reputation: 123
I have encountered same problem and found my mistake.
Make sure the phone numbers you send to controller.recipients are NSString. I have sent some long NSInteger and it goes to blank screen.
Upvotes: 0
Reputation: 21593
Problem was in this line:
controller.recipients = [NSArray arrayWithObject:phones];
It was a malformed phone # array. Not sure why the malformed phone # didn't raise an error, but filtering it out fixed the problem.
Upvotes: 3