title: Why will my app not open the SMS message composer?
body: <p>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:</p>
  
  <blockquote>
    <p>Error while [CKSMSComposeRemoteViewController: 0x1ddc2900] waiting for service to execute viewWillAppear: Error Domain=XPCObjectsErrorDomain Code=2 "The operation couldn’t be completed. (XPCObjectsErrorDomain error 2.)"</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>What is wrong with my code, and what does this error mean?</p>
  
  <p>Here is my code:</p>
  
  <pre><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);
          }
  </code></pre>
  
  <p>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.</p>