简体   繁体   English

iPhone短信应用问题

[英]Iphone sms app issue

iam making an application where i have to send a same body sms to my contact list . 我要提出一个应用程序,在该应用程序中我必须向我的联系人列表发送相同的短信。 I m using 我正在使用

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];

im taking out my contact one by one from my mutable array . 我从易变的阵列中逐一取出我的联系。 the problem is that my program sending an sms one at a time, not to the complete list. 问题是我的程序一次发送一个短信,而不是发送到完整列表。 and if i wanted to send sms to next person i have to click send button again. 如果我想发送短信给下一个人,我必须再次单击发送按钮。 is there any way i can send sms to everyone without clicking that send button again again? 有什么方法可以将短信发送给所有人,而无需再次单击该发送按钮?

u can check this app .... http://itunes.apple.com/us/app/automatic-custom-sms/id409247779 in this app last page comes automatically and send everyone from your contact list. 您可以检查此应用程序...。 http : //itunes.apple.com/us/app/automatic-custom-sms/id409247779在此应用程序的最后一页会自动出现,并从您的联系人列表中发送所有信息。 ?? ??

Ok i fix it. 好吧,我修复它。 i use a local variable an initialize it in view did load with value 0 and then in view did appear update it to 1 and make making present model view appear till my array finished. 我使用局部变量在视图中初始化了它并加载了值0,然后在视图中出现了将其更新为1,并使当前模型视图出现,直到我的数组完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM