I have a question about best practice in downloading data using NSOperation. Currently I am using NSOperationQueue to make multiple requests for JSON data on a remote server. When the data comes in I break it apart into one large NSDictionary and use for loops to parse it out and load the data into NSMutableDictionaries before I go on to the next request. My question is that I am performing this same sequence many times over and over again and I am wondering if it would be a better idea to just download the data and after all the downloads have been completed, then parse out my JSON into the needed Dictionaries, maybe there is a better way to do this that I am just not thinking of? I checked the total allocations using instruments and it looks like the I am pilling up around 30mb during this process.
Would appreciate any kind of advice on this matter.
Here is a small sample of NSOperation Code
plantPackKeys = [NSMutableDictionary dictionaryWithDictionary:data];
queueTwo = [NSOperationQueue new];
[queueTwo setMaxConcurrentOperationCount:4];
for(id key in data){
@autoreleasepool {
urlKey = @"";
urlKey = [data objectForKey:key];
DownloadOperation *downLoad = [[DownloadOperation alloc] initWithURL:[NSURL URLWithString:urlKey]];
[downLoad addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:NULL];
[queueTwo addOperation:downLoad];
}
}