now just replace this code with your code , may be its occurred because in phoneno or phone url somewhere whitespace is used so its not called..use this code..
NSString *phoneNumber = [[self.arrCategory objectAtIndex:0]objectForKey:@"MOBILE"];
NSArray* telComponents = [phoneNumber componentsSeparatedByCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
phoneNumber = [telComponents componentsJoinedByString: @""];
NSString* urlString = [NSString stringWithFormat: @"tel:%@", phoneNumber];
NSURL* telURL = [NSURL URLWithString: urlString];
if ( [[UIApplication sharedApplication] canOpenURL: telURL] )
{
[[UIApplication sharedApplication] openURL: telURL];
}
else
{
UIAlertView* alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString( @"Dialer Error", @"" )
message: [NSString stringWithFormat: NSLocalizedString( @"There was a problem dialing %@.", @"" ), phoneNumber]
delegate: nil
cancelButtonTitle: NSLocalizedString( @"OK", @"" )
otherButtonTitles: nil];
[alert show];
[alert release];
}
UPDATE:
try this also...
#import "RegexKitLite.h"
NSString * number = @"(555) 555-555 Office";
NSString * strippedNumber = [number stringByReplacingOccurrencesOfRegex:@"[^0-9]" withString:@""];
see the link for this code from iphone sdk - Remove all characters except for numbers 0-9 from a string