Use NSDictionary or create a class with properties?

I am starting to program in cocoa. In my mac os application, I save .webarchive files, and I also need to save some data only for the application (e.g. tags, etc.) Associated with this website. Should I use NSDictionary for these properties or create a class with @properties? What are the benefits of storing attributes in NSDictionary?

+4
source share
1 answer

Typically, the reason for creating the class / object is because you expect it to have some kind of behavior. So, if you are likely to repeatedly perform the same manipulations with the data that you save, then it is probably worth defining a class. If you just need to save the data and access it later, then NSDictionary will sound like a smarter choice.

+4
source

Source: https://habr.com/ru/post/1401213/


All Articles