0

I have been up and running with RestKit for ios and I feel it is great. But, I have some serious problem. I am trying to use the objectmapper in a application. While a test application with only a single view controller works fine and is able to load all the data in array. But, I try to integrate into the existing application, it always crashes with error ;

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x8b55e90'

I have a core data datamodel but I have not used it for the mapping until. The code in both the test application and the existing app are same. It is annoying that the same code works fine with a single view controller while the same things does not work for integration. Any help would be much appreciated !

Sandeep
  • 20,908
  • 7
  • 66
  • 106

2 Answers2

1

"unrecognized selector sent to instance" usually means that you are trying to call a method on an object that is no longer existent in memory. First you need to find out which object this is by enabling zombies in xcode.

Then you have to make sure that this object persists as long as you need it, e. g. make it a property of the parent view controller.

Community
  • 1
  • 1
RobDil
  • 4,036
  • 43
  • 52
0

There was error because I was using RestKit Object loader and RestKit client to load two different urls from the same controller at the same time. And both of them would call the request delegate at first. So, the json I was expecting the requestDidLoad delegate was different as it also loaded the same delegate for objectDidLoad at first. This has been fixed now.

Sandeep
  • 20,908
  • 7
  • 66
  • 106