*** Assertion failure in -[RKObjectMapping addPropertyMapping:] crash in ios

18 views
Skip to first unread message

shivang vyas

unread,
Jun 8, 2017, 1:49:25 PM6/8/17
to RestKit
hi guys, 

just started few days back with RestKit,
need your review, where i am wrong..
getting crash in ios app: *** Assertion failure in -[RKObjectMapping addPropertyMapping:]

@interface VGShowCheckIn : NSObject


@property (nonatomic,strong) NSNumber * ad_units;

@property (nonatomic,strong) VGShowDetails * program;



@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",

                                                      }];


and app is crashing here :  [checkinMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"program" toKeyPath:@"program" withMapping:showMapping]];


and rest api response is:

{

    data =     {

        "ad_units" = 3;

        program =         {

            id = SH017232340000;

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


can any one guide me whats wrong in line: 
[checkinMapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"program" toKeyPath:@"program" withMapping:showMapping]];

crash issue: 
*** Assertion failure in -[RKObjectMapping addPropertyMapping:]

Cleverson Luiz

unread,
Jun 8, 2017, 4:19:06 PM6/8/17
to res...@googlegroups.com
Hi! Have you tried Realm? I’m using it lately and love it! I highly recommend!

Cheers


-- 
You received this message because you are subscribed to the Google Groups "RestKit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages