An abstract superclass of a class cluster that scans values from a string.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
NSScanner object interprets and converts the characters of an
NSString object into number and string values. You assign the scanner’s string on creating it, and the scanner progresses through the characters of that string from beginning to end as you request items.
Because of the nature of class clusters, scanner objects aren’t actual instances of the
NSScanner class but one of its private subclasses. Although a scanner object’s class is private, its interface is public, as declared by this abstract superclass,
NSScanner. The primitive methods of
Scanner and all of the methods listed under Configuring a Scanner. The objects you create using this class are referred to as scanner objects (and when no confusion will result, merely as scanners).
You can set an
NSScanner object to ignore a set of characters as it scans the string using the
characters property. Characters in the skip set are skipped over before scanning the target. The default set of characters to skip is the whitespace and newline character set.
To retrieve the unscanned remainder of the string, use