1

i have following listing in my code.

- (IBAction)sendText:(id)sender {
if ([MFMessageComposeViewController canSendText]) {
    MFMessageComposeViewController *textSheet=[[MFMessageComposeViewController alloc]init];
    textSheet.messageComposeDelegate=self;
    [textSheet setBody:@"Demonic Possessions"];
    [self presentViewController:textSheet animated:YES completion:nil];

}  else  {
    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"Not Supported With Device" delegate:nil cancelButtonTitle:@"OK!" otherButtonTitles:nil, nil];
    [alert show];
}

}

But the receiver's number isn't specified anywhere in the code.

is it possible to send message with MFMessageComposerViewController to a specific contact number ?

if not, then how would i do it? a code would be very much helpful...

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

Use the recipients property. Set it up with an NSArray of phone numbers as NSStrings.

textSheet.recipients = @[@"1234", @"3234"];
allprog
  • 16,540
  • 9
  • 56
  • 97