JSOnModelでモデルをネストする

1964 ワード

{
    "data":{
        "gy_num":"30",
        "pgs":[
               {
                   "pgs_id":"1",
                   "products":[
                               {
                                   "product_id":"1",
                               },
                               {
                                   "product_id":"2",
                               }
                               ]
               },
               {
                   "pgs_id":"2",
                   "products":[
                               {
                                   "product_id":"1",
                               },
                               {
                                   "product_id":"2",
                               }
                               ]
               }
               ]
    },
    "success":true,
    "msg":"",
    "code":"0"
}

ProductModel.h @property (nonatomic, strong) NSString *product_id; PGSModel.h @property (nonatomic, strong) NSString *pgs_id; @property (nonatomic, strong) NSArray* products; GYModel.h @property (nonatomic, strong) NSString *gy_id; @property (nonatomic, strong) NSArray* pgs; model _gyModel = [[GYModel alloc] initWithDictionary:dicData error:&error];取得
cell.modelのsetメソッドを使用してエラーを報告した場合:_dataList = [NSMutableArray arrayWithArray:_gyModel.pgs] cellにはinvalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution. libc++abi.dylib: terminate_handler unexpectedly threw an exceptionと書くべきです.