I have:
1) Starting 2 asynchron NSUrlRequests simultaneously
2) As soon as one of the two requests has loaded XML data, an NSOperationQueue is used to start a XML parser. Hereby, the ParseOperations work excatly as in Apple's LazyTableImages example.
InfoRequestHelper.m
// ...
case GetBlogEntries:
{
BlogParseOperation *parser = [[BlogParseOperation alloc] initWithXMLString:result delegate:self];
parser.tag = helper.requestTag;
[queue addOperation:parser]; // this will start the "ParseOperation"
[parser release];
break;
}
case GetTweets:
{
TwitterParseOperation *parser = [[TwitterParseOperation alloc] initWithXMLString:result delegate:self];
parser.tag = helper.requestTag;
[queue addOperation:parser]; // this will start the "ParseOperation"
[parser release];
break;
}
// ...
3) When parsing is finished parser:didFinishParsing: fires.
InfoRequestHelper.m
- (void)parser:(ParseOperationBase *)parser didFinishParsing:(NSArray *)entries
{
// Save data, remove completed request from list
[self.requestsInProgress removeObjectForKey:parser.tag];
[self.resultObjects addObjectsFromArray:entries]; // <= !!! EXC_BAD_ACCESS !!! here
// ..
}
The problem: When the first event arrives here, objects can be added to the array. But when the second arrives, there is an EXC_BAD_ACCESS.