ibireme/YYModel

请把 `+[NSArray yy_modelArrayWithClass:MyModel.class json:json]` 改成 `+[NSObject (YYModel) yy_modelArrayWithJson:json]`

heistings opened this issue · 0 comments

这个接口定义不太合理,

+[NSArray yy_modelArrayWithClass:MyModel.class json:json]

不如

+[MyModel yy_modelArrayWithJson:json]

自然。

@interface NSArray (YYModel)

/**
 Creates and returns an array from a json-array.
 This method is thread-safe.
 
 @param cls  The instance's class in array.
 @param json  A json array of `NSArray`, `NSString` or `NSData`.
              Example: [{"name","Mary"},{name:"Joe"}]
 
 @return A array, or nil if an error occurs.
 */
+ (nullable NSArray *)yy_modelArrayWithClass:(Class)cls json:(id)json;

@end