***断言失败 - [RKObjectMapping addPropertyMapping:]在ios

时间:2017-06-08 17:53:18

标签: restkit

几天前用RestKit开始, 需要你的评论,我错了.. 在ios app中崩溃:***断言失败 - [RKObjectMapping addPropertyMapping:]

@interface VGShowCheckIn:NSObject

@property(非原子,强)NSNumber * ad_units;

@property(非原子,强)VGShowDetails *程序;

@interface VGShowDetails:NSObject

@property(copy,nonatomic)NSString * programTitle;

@property(copy,nonatomic)NSString * showId;

=======

RKObjectMapping * checkinMapping = [RKObjectMapping mappingForClass:[VGShowCheckIn class]];

[checkinMapping addAttributeMappingsFromDictionary:@{

                                                  @"ad_units" : @"ad_units",

                                                  @"program" : @"program"

                                                  }];





RKObjectMapping *showMapping = [RKObjectMapping mappingForClass:[VGShowDetails class]];

[showMapping addAttributeMappingsFromDictionary:@{

                                                  @"id"                                         :   @"showId",

                                                  @"title"                      :   @"programTitle",

                                                  }];

并且app崩溃了:[checkinMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@“program”toKeyPath:@“program”withMapping:showMapping]];

和休息api的回应是:

{

data =     {

    "ad_units" = 3;

    program =         {

        id = SH017232340000;


        title = "Man v. Food Nation";
    }
 }

}

任何人都可以指导我错误排队: [checkinMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@“program”toKeyPath:@“program”withMapping:showMapping]];

崩溃问题:***断言失败 - [RKObjectMapping addPropertyMapping:]

0 个答案:

没有答案