IOS restkit error
Posted
by
user1302602
on Stack Overflow
See other posts from Stack Overflow
or by user1302602
Published on 2012-07-02T07:48:18Z
Indexed on
2012/07/02
9:16 UTC
Read the original article
Hit count: 238
I am sending a Post with object loader and getting this error in output window.
FYI, My didFailWithError:
delegate never got hit. Not sure why.
`objectLoader:didFailWithError:]:` unrecognized selector `sent to class 0x123608`
How did i find out what is 0x123608?
I set the router in AppDelegate class and Mapping in AppDelegate too.
here is a method in my class which inherit RKObjectLoaderDelegate. I am using shared singleton.
[[RKObjectManager sharedManager] postObject:review usingBlock:^(RKObjectLoader *loader){
// loader.params=params,
loader.objectMapping = [[RKObjectManager sharedManager].mappingProvider objectMappingForClass:[myclass class]];
loader.serializationMIMEType = RKMIMETypeJSON; // We want to send this request as JSON
loader.method = RKRequestMethodPOST;
loader.serializationMapping = [RKObjectMapping serializationMappingUsingBlock:^(RKObjectMapping* mapping) {
[mapping mapAttributes:@"field1", @"field2",@"field3",nil];
}];
loader.targetObject = nil;
loader.delegate = self;
}];
}
© Stack Overflow or respective owner