Monday, December 5, 2011

Essential Foundation Classes

Now that we have a better handle on how object oriented programming works on iOS we should go over some of the key Foundation classes that you will use in your own apps. Like the name suggests, Foundation supports the key frameworks used in iOS development. Most of what you will be doing when building iOS apps comes from Foundation and will use Foundation classes.

Foundation Inheritance Hierarchy

Remember that classes can have an inheritance relationship with other classes. Although we did not mention it specifically we have already seen classes in Foundation that are in an inheritance relationship. The two classes that I am talking about are NSObject and NSString. NSString inherits from NSObject. You might also say that NSString is a kind of NSObject. Because of this relationship, NSString has all the properties and methods it needs to be and do what an object is.