Comparing C and Objective-C
The key difference between C and Objective-C is that Objective-C deals only with objects. You can include C data types in Objective-C code, but if you want to integrate them with Objective-C objects—for example, if you want to store numbers in an NSArray object—you must “objectify” them first by wrapping them inside an object. Full details are moderately complex and outside the scope of this book. For more information, see Cocoa in Wiley’s Developer Reference series.
Note also that Objective-C includes denser and more abstract options than C. For example, you can use automatic enumeration to loop through every object in an array and run code on each object repeatedly. The enumeration works even when the array contains objects of different types. For details and example code, see the NSArray class reference.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access