我有一个发送短信然后拨打动态电话号码的应用程序,代码如下:
#pragma mark - PictureListMainTableCellDelegate methods
-(void)pictureListMainTableCell:(PictureListMainTableCell *)cell wantsToCallNumber:(NSString *)number
{
MFMessageComposeViewController *messageComposer =
[[MFMessageComposeViewController alloc] init];
NSString *message = @"Your Message here";
[messageComposer setBody:message];
messageComposer.recipients = [NSArray arrayWithObjects:@"0003233", nil];
messageComposer.messageComposeDelegate = self;
[self presentViewController:messageComposer animated:YES completion:nil];
NSLog(@"Texting telephone number [%@]", messageComposer);
NSString *urlString = [NSString stringWithFormat:@"tel://%@", number];
NSLog(@"calling telephone number [%@]", number);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
NSLog(@"%@", [self deviceLocation]);
}
电话有效,但短信无效,有人可以帮忙吗?