Exercises
Use @dynamic, +resolveInstanceMethod, and the class_addMethod() function to add a property implementation method at runtime. Manipulating the Objective-C runtime is not covered here, but you can find out about this in Apple’s Objective-C 2.0 Runtime Reference.
Measure the performance of atomic and nonatomic properties in garbage collected and non-garbage collected environments. Are there real performance differences?
The requirement that collections not mutate while you are iterating over them can be inconvenient at times, especially if you are doing a “scan the collection and pull out stuff that shouldn’t be there” operation. What would it take to make a classic array enumerator support having the collection mutated during iteration? ...
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