Abusing NSDictionary

Lately I’ve been more aware of developers using NSDictionary where a class should be used. While it may seem easier to use an NSDictionary to store data and pass it around, the lack of type checking and easily mistype keys is prone to failure. Creating classes with a bunch of properties has gotten even easier with the latest version of Xcode; you don’t even have to synthesize properties. Just define the properties and presto, you have a class where you would have used an NSDictionary. NSDictionaries have their place, but in many cases classes serve developers better.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.