2011-02-02 92 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,并使当前模型视图出现,直到我的数组完成。