Friendly reminder. If you register for a notification with the notification center, you must unregister on dealloc. If our object goes away, but is still registered to receive notifications, your application will crash.
Here are a few keyboard shortcuts that I have learned to love:
- ESC – Kicks in Autocomplete, including a drop down list of all available properties/methods for the current symbol.
- ⌘Enter – Builds and Runs
- ⌥⌘↑ – Switches between header and source files.
Objective C is a loosely typed language, where type “id” is passed to most methods. When operating with an “id” you can call methods (message) that may not even exist. This will create a run-time exception, not a compile time error. Moving from a strongly typed language like Java, this is a little disconcerting. I’ve been making sure to learn all about Objective C’s Type Introspection in order to combat my fear.
There are two functions for Type Introspection: isKindOfClass and isMemberOfClass.
If we have the following class structure:

The following conditions apply:
[dog isKindOfClass:[Animal class]]; //is TRUE
[dog isMemberOfClass:[Dog class]]; //is TRUE
[dog isMemberOfClass:[Animal class]]; //is FALSE
So, isKindOfClass denotes whether a class is an instance of another class or an instance of a subclass. While isMemberOfClass denotes if the class is an instance of the specified class (i.e. subclasses do not evaluate to true).
For Java folks, isKindOfClass is equivalent to instanceof and isMemberOfClass is equivalent to (obj.getClass() == MyObject.class).