↧
-description, Little-Known Hero of Debugging
Or: How to Make NSLog() Useful With Your Objects Say you have an archaically named NSArray that you want to inspect — it’s easy to do, since NSLog(@"The bestiary is %@", bestiary); prints out the...
View ArticleHow To Write Cocoa Object Setters
There are several ways to write setters for Objective-C/Cocoa objects that work. But here are the practices I follow; to the best of my knowledge they produce the safest code. Principle 0: Don’t Write...
View ArticleHow To Write Cocoa Object Getters
Setters are more straightforward than getters, because you don’t need to worry about memory management. The best practice is to let the compiler write getters for you, by using Declared Properties. But...
View Article