Disadvantages of using dictionaries
In general, setting the data and fetching the data are all "string type key", when writing these keys, the compiler will not have any friendly hints, need to hand knock
dict[@ "name"][email protected] "Kevin";
NSString *name=dict[@ "name"];
Hand knocking string Key,key easy to write wrong
If the key is incorrectly written, the compiler will not have any warnings or errors, resulting in incorrect data or incorrect data.
Benefits of using Models
The so-called model, in fact, is the data model, specifically used to hold the data object, use it to represent the data will be more professional
The model sets the data and takes out the data through its properties, the property name if the error is written, the compiler will immediately error, so that the correctness of the data
When using a model to access properties, the compiler provides a series of hints to improve coding efficiency
The benefits of replacing dictionaries with models in iOS