iphone - How to send two or more SMS messages in iOS, in synchronized fashion -
i relatively new ios development , have question. have need send multi part sms message. understand can take long message , pass 'mfmessagecomposeviewcontroller' , break me accordingly. however, not work, because every message send has specific delimiter , need every single 1 of messages begin identical delimiter. so, have tried utilize loop, , display each controller after other. however, 'mfmessagecomposeviewcontroller' other message parts not beingness displayed, shows initial message. warning displayed in terminal this
"attempt nowadays < mfmessagecomposeviewcontroller: 0x126819200> on < viewcontroller: 0x12660ae80> waiting delayed presention of < mfmessagecomposeviewcontroller: 0x12683b200> complete"
any suggestions? tried using code blocks , synchronizing each controller displayed in synchronized fashion, did not work. code below
nsmutablearray *strings = [smsbuilder createsms:160 stringtoconvert: addoredit:@"personadd"]; void (^send)(nsstring *) = ^(nsstring *str){ mfmessagecomposeviewcontroller *controller = [[mfmessagecomposeviewcontroller alloc]init]; @synchronized(controller){ [controller setbody:str]; [controller setmessagecomposedelegate:self]; [controller setrecipients:[nsarray arraywithobjects:@"111-111-1111", nil]]; [self presentviewcontroller:controller animated:yes completion:^(void){}]; } }; for(int i=0;i<[strings count];i++) send([strings objectatindex:i]);
mfmessagecomposeviewcontroller has delegate protocol inform when has completed sending. need dismiss viewcontroller in method , completion block, show next part.
- (void)messagecomposeviewcontroller:(mfmessagecomposeviewcontroller *)controller didfinishwithresult:(messagecomposeresult)result { [controller dismissviewcontrolleranimated:yes completion:^{ [self shownextmessagepart]; }]; }
ios iphone sms messaging
No comments:
Post a Comment