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
  • DownloadDownload
  • PrintPrint

7.2. Mutability

Most of the base Foundation value classes come in two flavors: mutable and immutable. The word “mutable” means that the value of the object can be changed. You can’t change the contents of an NSString once you create it, but you can change the contents of an NSMutableString:

NSMutableString* name = [NSMutableString stringWithString:@"Helen"];
[name setString:@"Sarah"];
[name setString:@"Daisy"];


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial