Sunday, September 29, 2013

iphone how to dynamically generate a phone number to dial

This method is the following telephone numbers written in the form of a fixed string, click the button to open the Phone Dialer
NSURL * url = [[NSURL alloc] initWithString: @ "tel :021-99999999"];
[[UIApplication sharedApplication] openURL: url];



But the following telephone number is dynamically generated on the dial is always me, the point of no response

/ / Number is dynamically generated telephone numbers, number is retrieved from the remote json request, access is no problem, log trace display correctly displayed in ihone buttons are also correct

NSString url = [[NSString alloc] initWithFormat: @ "tel:% @", number];
[[UIApplication sharedApplication] openURL: url];



Question: how to dynamically generate a phone number to dial
Reply:
Type a mistake
NSUrl * url = [[NSUrl alloc] initWithString: @ "tel:% @", number];
[[UIApplication sharedApplication] openURL: url];


Reply:
Type a mistake
NSUrl * url = [[NSUrl alloc] initWithString: @ "tel:% @", number];
[[UIApplication sharedApplication] openURL: url];


Reply:
NSURL * url = [[NSURL alloc] initWithString: [NSString stringWithFormat: @ "tel:% @", number]];
[[UIApplication sharedApplication] openURL: url];

Reply:
shi de
Reply:
2nd Floor positive solution, you have to pass a url into ah. Pass a nsstring certainly not acceptable.

No comments:

Post a Comment