Name
NSScanner — Mac OS X 10.0
Synopsis
This class declares an API for objects that can interpret and convert
a string into individual number and string values. When you create a
scanner object, you assign it the string to scan. Scanner objects are
created with the method scannerWithString:, or
initialized with initWithString:. A
scanner
works by interpreting and converting string and number values based
on the scan message sent to the scanner object. For example, if the
method scanInt: is invoked, the scanner will scan
through the string searching from the next available integer.
Scanning usually happens within a loop, until the entire string has
been scanned. Clients can test whether or not the scanner is at the
end of the string using the method isAtEnd.
|
|
@interface NSScanner : NSObject <NSCopying>
|
// Convenience Constructors
|
+ (id)scannerWithString:(NSString *)string; |
// Initializers
|
- (id)initWithString:(NSString *)string; |
// Accessor Methods
|
- (void)setCaseSensitive:(BOOL)flag; |
- (BOOL)caseSensitive;
|
- (void)setScanLocation:(unsigned)pos; |
- (unsigned)scanLocation;
|
- (void)setCharactersToBeSkipped:(NSCharacterSet *)set; |
- (NSCharacterSet *)charactersToBeSkipped;
|
- (void)setLocale:(NSDictionary *)dict; |
- (NSDictionary *)locale;
|
// Class Methods
|
+ (id)localizedScannerWithString:(NSString *)string; |
// Instance Methods
|
- (BOOL)scanCharactersFromSet ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access