How to use NSScanner?
- by Zopi
Hi,
I've just read Apple's docu of NSScanner.
I'm trying to get the integer of that string: @"user logged (3 attempts)".
I can't find any example, how to scan within parentheses. Any ideas?
Here's the code:
NSString *logString = @"user logged (3 attempts)";
NSScanner *aScanner = [NSScanner scannerWithString:logString];
[aScanner scanInteger:anInteger];
NSLog(@"Attempts: %i", anInteger);
Regrads,
Ruby