I have a json parser with AFHTTPRequestOperation
.
my parsing code:
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.responseSerializer = [AFJSONResponseSerializer serializer];
and I have a NSMutableArray
@property (strong, nonatomic) NSMutableArray * myDirectory;
First, I load main 10 items and add with this:
self.myDirectory = responseObject;
After, when I want to load more 10 items, I tried many things but error is:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[__NSCFArray insertObject:atIndex:]:
mutating method sent to immutable object'
I tried:
[self.myDirectory insertObject:[responseObject mutableCopy] atIndex:[self.myDirectory count]];
[self.myDirectory addObjects:responseObject];
etc...
What I must use?