KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
OK So here's the plan. The XML I'm getting data from allows non-numeric text in phone number fields (for descriptions or contact names, etc). I am trying to extract only the numbers and call the tel: URL with them to initiate a call. Here's whats NOT working: NSCharacterSet *charset = [[NSCharacterSet decimalDigitCharacterSet] invertedSet]; NSString *number = @"(555) 555-5555 Office"; NSString *strippedNumber = [number stringByTrimmingCharactersInSet:charset]; NSString *phoneURL = [NSString stringWithFormat:@"tel:%@", strippedNumber]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneURL]]; if there are any obvious typos, they're just typos. :)
Tags (comma-separated)
Save Edits
Cancel