O'Reilly logo

Objective-C Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 6

image

Strings

NSString

NSString is the class used in Objective-C to work with strings. NSString manages the list of characters that forms a string. NSString objects are immutable, which means that once you create an NSString object you can’t change it.

NSString objects can be created with many different constructors, but the most common way you’ll see NSString objects created is with the @ symbol followed by quotes. In fact, you’ve seen this already in the Hello World example from Chapter 1.

NSLog(@"Hello, World!");

That parameter is an NSString object, although it’s hard to see since you don’t need the explicit NSString declaration here. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required