I am unclear what's the most appropriate way to represent simple data objects with properties in cocoa.
In Java, java beans make a lot of sense to implement such objects: declare all the properties of your object and create getters and setters for each of these properties.
In cocoa, we can follow the same approach. But you can also just use an NSDictionary. Which approach makes most sense when?
Taking a concrete example: what's the most "appropriate" way of representing vehicles that have, say, two properties: number of axles, and color? Do you create a Vehicle class that subclasses NSObject and that has two properties numberOfAxles and color? Do you create a subclass of NSDictionary with two keys?
The former approach seems cleaner to me but when I look at code samples from Apple, (e.g. UICatalog), I see arrays of dictionaries everywhere to represent data sources. Seems odd to me. Is is just because NSDictionary offers a quick and dirty way of representing data objects, which is practical in the context of simple, self-contained examples?
If you want to simply represent a vehicle (with no future extensions,etc and no functionality) then using a dictionary should be fine. (Although, I would use a Vehicle class)
Also, apple's examples are to show APIs/SDK usage only. In 99% of the cases they don't aim to teach design patterns or objective-c language.