在下面的代码中,我是否正确理解了保留周期问题,是否会有保留周期?
- (NSError *)importRoute:(NSDictionary *)route {
[self.importContext performBlockAndWait:^{
[NSEntityDescription insertNewObjectForEntityForName:@"Entity" inManagedObjectContext:self.importContext];
//do I get a retain cycle here?
}];
...
}
- (NSManagedObjectContext *)importContext {
if (!_importContext) {
id appDelegate = [[UIApplication sharedApplication] delegate];
_importContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
_importContext.parentContext = [appDelegate managedObjectContext];
}
return _importContext;
}