int total = 0;
NSString *str = @"123-456-7890";
for(int i=0; i<[str length];i++)
{
unichar c = [str characterAtIndex:i];
if (![[NSCharacterSet alphanumericCharacterSet] characterIsMember:c])
{
NSLog(@"%c",c);
total++;
}
}
NSLog(@"%d",total);
this worked. hope it helps. happy coding :)