NSObject+YYModel.h ? //NSObject的Category
YYClassInfo.h ? ? ?//運(yùn)用NSRuntime來提取Class的如下信息:
字段信息YYClassIvarInfo ? ?//@property xxx ? + ? 字段
方法信息YYClassMethodInfo
屬性信息YYClassPropertyInfo? //@property xxx
然后將某個類生成的的YYClassInfo存入緩存中,下次用到直接讀緩存里的數(shù)據(jù)。
根據(jù)YYClassInfo里的信息生成YYModelMeta,便存入緩存中。
最后根據(jù)
a. Json對象轉(zhuǎn)換而來的字典或數(shù)組
b. YYModelMeta信息
c. SomeObject (self)
根據(jù)a和b給SomeObject的屬性賦值。