I am trying to get my app to open the SMS message composer and I get this weird error when the app tries to launch the composer:
Error while [CKSMSComposeRemoteViewController: 0x1ddc2900] waiting for service to execute viewWillAppear: Error Domain=XPCObjectsErrorDomain Code=2 "The operation couldn’t be completed. (XPCObjectsErrorDomain error 2.)"
I have never seen any error remotely close to this, and I have no idea why I am getting it as I found almost the same code online, tried it, and it worked.
What is wrong with my code, and what does this error mean?
Here is my code:
if ([MFMessageComposeViewController canSendText]) {
NSLog(@"can send text");
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.recipients = [stringComponents objectAtIndex:1];
picker.body = [stringComponents objectAtIndex:2];
[self presentModalViewController:picker animated:YES];
NSLog(@"%@", picker.recipients);
NSLog(@"%@", picker.body);
}
When building the above code, I get no error messages in Xcode, and I am able to load the screen to the point that I want to open the message composer, then it crashes and shows the message. Thank you for your response in advanced.