NSString methods
NSString is a class that developers use a lot. Like all Objective-C classes, it comes with useful methods. If you want to do something with a string, there is likely an NSString method that can help.
Below are a few examples of NSString methods. To introduce these methods, we are showing you the declaration of the method and then an example of it being used. The declaration tells you what you need to know about a method: whether it is an instance or a class method, what it returns, its name, and the types of its arguments, if any.
To get the number of characters in a string, you use the length method:
- (NSUInteger)length;
This method is an instance method. You can tell by the ‘-’ at the start of the declaration. ...
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