O'Reilly logo

iOS App Development Portable Genius by Richard Wentk

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

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.

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