4
我有一個問題,通過JSONModel libraryJSONModel不良屬性協議聲明?
{"images":[{"id":1,"name":"name1","img":"3423","note":"note1"},{"id":2,"name":"name2","img":"rew","note":"note2"},{"id":3,"name":"name3","img":"dsfs","note":"note3"},{"id":4,"name":"name4","img":"cxvxc","note":"note4"},{"id":5,"name":"name5","img":"erwe","note":"note5"}]}
閱讀JSON類模型
#import "JSONModel.h"
@protocol ImagesModel @end
@interface ImagesModel : JSONModel
@property int id;
@property (strong, nonatomic) NSString* name;
@property (strong, nonatomic) UIImage* img;
@property (strong, nonatomic) NSString* note;
@end
,我得到這個錯誤
Terminating app due to uncaught exception 'Bad property protocol declaration', reason: '<ImagesModel> is not allowed JSONModel property protocol, and not a JSONModel class.'
任何幫助嗎?
當我們執行「initWithDictionary」並且Json響應有一個字典數組時,它返回一個JSONModelError「嘗試使用initWithDictionary初始化JSONModel對象:錯誤:但字典參數不是'initDithDictionary模型中的'NSDictionary'」。 – 2015-08-14 13:52:42