O'Reilly logo

Mac Programming for Absolute Beginners by Wallace Wang

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 9. Manipulating Strings

In previous chapters, you learned how to store integer and floating-point numbers in a variable. However, one of the more common types of data to store is text, otherwise known as a string.

There are two parts to a string in Objective-C. First, you must identify a string by using the @ symbol, which identifies the string as a special Objective-C string. Second, you must enclose the string inside double quotation marks, such as @"This is a string" or @"555-1212 is also a string." Strings can contain any characters, including numbers, symbols, and letters.

To store and manipulate strings when creating Mac programs, you use a string class called NSString. One advantage of creating an object from an NSString class is ...

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