I want a custom class object to hold data and have somehow the feeling that creating about 80 properties is not the best way of doing it.
Most of the properties would be bool values, so i’m thinking about creating Arrays (keys / values) or (probably better) a NSDictionary attached to the object for holding the data. Does that make sense or should i stay with the properties?
Extra: Are there general pros and cons for the different approaches? And what keywords / concepts do i have to search for to find discussions about that somehow general question?
Thanks in advance
You should use classes for creating objects (in future program), if you expect some behavior. I mean, object – is not only something that stores variables. It also supposes some sort of activity (called behavior). And properties are not only the way to set some values (as object’s characteristics), but also the way to influence on this behavior (you can add extra code parts, except just saving data – some checks or smth.else).
And if you need only the construction to store data – it’s not just better, it’s a more logical step to store them as an array or a dictionary.
Dictionary is better in most cases, cause you can access stored values by key names. And your code will be much more understandable. But array should be (I don’t know exactly, only suppose) faster to access (it’s harder to find string key among other strings than index among sequence of incremented numbers).