I am simply trying to retrieve one item from my restful service (confirmed working)
http://www.example.com/person/25
I need to somehow pass in the '25' part of the URL. I figure that I'm supposed to use RKRoute. The way to execute this in RestKit is to use the getObject: method of RKObjectManager.
Using RestKit 0.22 and I do not know how to call the getObject: method because it expects a full Person object, no? Even though I only need to pass in the string '25'.
The method in question is: [self getObject:personNSManagedObject path:nil parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) .....
I can't just say "Person *person = [[Person alloc] init] because Person is an NSManagedObject.
But when I do this:
NSManagedObjectContext *moc = self.managedObjectStore.mainQueueManagedObjectContext;
NSEntityDescription *person = [NSEntityDescription entityForName:@"Person" inManagedObjectContext:moc];
Person *personNSManObj = [[Person alloc] initWithEntity:person insertIntoManagedObjectContext:nil];
personNSManObj.id = 3;
I get the following error:
Performing object mapping to temporary target objectID. Results may not be accessible without obtaining a permanent object ID. restkit.network:RKResponseMapperOperation.m:457 Failed to retrieve existing object with ID: 0x1664ac90
Any ideas?