*emphasized text*So I'm using restkit to pull back a bunch of objects to display in a UI Collection view. I get my initial mapping result, which is an NSArray of MyCell Objects.
I invoke the given success block and return the mappingResult.array to the caller of my getCellObjects service method.
Now in the calling viewController I just want to set my local NSArray property that drives my UICollectionView to the one I go from restkit's mapping.
[[MyService sharedClient] getCellObjectsWithSuccess:^(RKObjectRequestOperation *op, RKMappingResult mappingResult){
self.myCells = [[NSMutableArray alloc] initWithArray:mappingResult.array];
}
In the example, self.MyCells is an NSMutableArray and mappingResult.array is an NSArray.
I'm new to objective-c. Is there a way to set result array from restKit to my local NSArray property?
The goal is that once the call to getCellObjects is done, I don't need the mappingResult.array anymore so it should be discarded and it's contents should be transferred over to self.MyCells.
The error I get on the call to initWithArray is Terminating app due to uncaught exception 'NSInvalidArgumentException', reason'-[__NSArrayM array]: unrecognized selector sent to instance [some memory address]