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 2. An Objective-C Primer > Declaring Objective-C Types

Declaring Objective-C Types

From: cast.m

 6 NSMutableArray *mutableArray = [NSMutableArray
        new];
 7 NSArray *array = mutableArray;
 8 NSObject *object = array;
 9 id obj = mutableArray;
10 mutableArray = (NSMutableArray*)object;
11 mutableArray = obj;

Objective-C, as its name implies, adds objects to C. Specifically, objects following the Smalltalk model, which are instances of classes. Objects are always allocated on the heap and so are always referenced by pointer.


  

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