1

I am working with RestKit-0.20.3 and faced a problem I have a Student table in database. For getting student history perform get api call, url like this https://xyz.com/api/getStudentHistory?x=a&y=b&z=c with some parameter. Using this method

 [[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)

In 'path' parameter passing- path = https://xyz.com/api/getStudentHistory

I got this error when server send response.

CoreData: error: Failed to call designated initializer on NSManagedObject class ’Student’ 

After that I am getting this message and application become crash.

Uncaught exception [<Student 0xd36b3e0> valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key "notes".
     Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Student 0xd36b3e0> valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key "notes".'
Dipak
  • 2,263
  • 1
  • 21
  • 27
  • possible duplicate of [The entity (null) is not key value coding-compliant for the key "title"](http://stackoverflow.com/questions/14268580/the-entity-null-is-not-key-value-coding-compliant-for-the-key-title) – Wain Apr 05 '14 at 07:23
  • The combination of base URL and path pattern need to create a valid URL in all cases and path pattern alone is used to match descriptors. – Wain Apr 05 '14 at 07:23
  • Yes @Wain you are right, I got clue from there I mentioned it. – Dipak Apr 05 '14 at 14:48

1 Answers1

1

After R&D and spending a lot of time got a clue from here The entity (null) is not key value coding-compliant for the key "title"

Simply replace my path parameter from path = https://xyz.com/api/getStudentHistory to path = /api/getStudentHistory in method

[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)

Now my problem solved……:)

Community
  • 1
  • 1
Dipak
  • 2,263
  • 1
  • 21
  • 27