Returns a person name components object from a given string.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
A string that is parsed to create a person name components object.
NSPerson object parsing string using the receiver’s format, or
nil if no components could be parsed.
This method uses a combination of locale rules and heuristics to determine the most likely name components for a particular string representation. Parsing name components from a representation created for an existing name components object may not produce equivalent results.
Here are some general rules that describe the name component parsing behavior:
Names in Latin script have components delimited by whitespace.
Names with a single delimited component are parsed into their most likely name component.
Names in Latin script with more than two delimited components may include middle components in the
Names in Latin script that are inverted may be parsed into components in a different order than they appear; names in CJK script that are inverted will not typically produce the correct results.
Names in Latin script may use a comma to indicate name inversion.
Names in Latin script have capitalization preserved between string representation and parsed components.
Text between parentheses or brackets, as well as extraneous characters in names is ignored.
Jonathan Paul Appleseed
John Paul Appleseed
Jonathan P. Appleseed
Dr. Jonathan, Esq.
Jonathan (a.k.a. Johnny) Appleseed 🍎
Jean-Philippe de Zélicourt
José Ramiro Martín González de Rivera
Martín González de Rivera