the following code:
-(void)sendSMS
{
NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
if ([MFMessageComposeViewController canSendText])
{
self.msgController = [[MFMessageComposeViewController alloc]init];
self.msgController.messageComposeDelegate = self;
self.msgController.body = [standardUserDefaults objectForKey:@"geoAlarmDistressFlareMsgText"];
self.msgController.recipients = [standardUserDefaults objectForKey:@"geoAlarmDistressFlareTelNumbers"];
[self presentModalViewController:self.msgController animated:YES];
}
}
...causes the app to crash when run on my iphone at the [[MFMessageComposeViewController alloc]init]; line with the following error:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance
I don't understand why - the msgController is declared (and synthesized) as a MFMessageComposeViewController, and i have declared the delegate and delegate method. Any ideas? No other questions on here seem to be asking the same question...