Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Handling Data > Passing Messages to String Objects

Passing Messages to String Objects

As with other Objective-C objects, you communicate with NSString objects by passing them messages. For example, passing a string the message length returns its length, and passing it the message getSubstringFromIndex lets you get a substring.

For example, if you want to convert a string that contains an integer into an actual integer, you use the intValue message, which you send like this:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint