3
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?

0xSina
  • 20,973
  • 34
  • 136
  • 253

2 Answers2

3

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.

0xSina
  • 20,973
  • 34
  • 136
  • 253
  • 2
    I don't understand. What did you filter? I have the same kind of problem, but it comes only some percent of the time, while other time works great. Thanks! – Tom Mar 26 '14 at 13:36
0

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.

mengxy
  • 123
  • 7