2011-01-20 66 views

回答

1

如果有人在尋找我自己做過的代碼。

if(appdelegate.dataarray.count> 0)NSMutableArray * dataarrrr = [appdelegate.dataarray objectAtIndex:0]; NSLog(@「%@」,[dataarrrr objectAtIndex:0]); NSString * aa = [dataarrrr objectAtIndex:0]; NSMutableArray * myArray = [aa componentsSeparatedByString:@「,」];

  NSString *n = [myArray objectAtIndex:0]; 
      NSString *m=[myArray objectAtIndex:1]; 
      NSString *Message = [dataarrrr objectAtIndex:1]; 
      NSString *new = [Message stringByReplacingOccurrencesOfString: @"<Dear User>" withString:n]; 
      controller.body = new; 
      controller.recipients= [NSArray arrayWithObject:m]; 
      controller.messageComposeDelegate = self; 
      [self presentModalViewController:controller animated:YES]; 

       } 
0

請參閱MFMessageComposeViewController,您可以在顯示消息編排器之前設置SMS正文。我不認爲有更好的方式發送短信,看到這個related question

+0

問題是你不能在你點擊收件人的名字後改變短信的正文。我想在選擇一個我想發送短信的人之後改變短信的身體。 – 2011-01-20 08:23:39

相關問題