2011-02-02 104 views
0

我做了一個應用程序,我必須發送相同的身體短信到我的聯繫人列表。我使用Iphone短信應用問題

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController")); 
    if (messageClass != nil) 
    { 
     MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease]; 
     if([MFMessageComposeViewController canSendText]) 
     { 
if ([appdelegate.NumberArray count] > 0) { 


      NSString *aa = [appdelegate.NumberArray objectAtIndex:0]; 
      NSMutableArray *myArray = [aa componentsSeparatedByString:@","]; 


      NSString *n = [myArray objectAtIndex:0]; 
      NSString *m=[myArray objectAtIndex:1]; 
      NSString *new = [appdelegate.globalmsg stringByReplacingOccurrencesOfString: @"forgot" withString:n]; 
      controller.body = new; 
      controller.recipients= [NSArray arrayWithObject:m]; 
      controller.messageComposeDelegate = self; 
       //if([appdelegate.NumberArray count] ==2){ 
        [self presentModalViewController:controller animated:YES]; 

即時從我的可變數組中取出我的聯繫人。問題是我的程序一次發送一個短信,而不是完整的列表。如果我想發短信給下一個人,我必須再次點擊發送按鈕。有沒有什麼辦法可以發送短信給大家,而無需再次點擊發送按鈕?

你可以檢查這個應用程序.... http://itunes.apple.com/us/app/automatic-custom-sms/id409247779在這個應用程序的最後一頁自動發送和發送你的聯繫人列表中的每個人。 ??

+0

請幫助其排除... – 2011-02-03 07:42:53

回答

1

好吧我修復它。我使用了一個局部變量,在視圖中進行初始化,然後在視圖中加載值爲0,然後在視圖中出現更新爲1,並使當前模型視圖出現,直到我的數組完成。