4

Has anybody encountered this kind of error in MFMessageComposeViewController?

I allocated and presented it like this:

    MFMessageComposeViewController *message = [[MFMessageComposeViewController alloc] init];
    message.messageComposeDelegate = self;

    [[UIApplication sharedApplication].delegate.window.rootViewController presentModalViewController:message animated:YES];

but it presents an empty view and says:

Application tried to push a nil view controller on target <MFMessageComposeViewController: 0x96d1380>.

Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
Arnlee Vizcayno
  • 2,405
  • 3
  • 23
  • 31

1 Answers1

3

Possible duplicate of MFMessageComposeViewController on Simulator - canSendText?

Basically this occurs in the simulator on Lion and Mountain Lion if it has a Messages account enabled. Try testing on a real device as it should work okay there.

Community
  • 1
  • 1
appmattus
  • 2,788
  • 25
  • 16
  • Actually, I have tested in device and it work. I remember on the previous xcode versions opening the iMessage on simulator make it crash and now will display white view. – Arnlee Vizcayno Oct 08 '12 at 03:47