【发布时间】:2013-05-07 22:28:03
【问题描述】:
如何强制自动释放池释放我在自动释放池之外创建的自动释放对象{}
我正在使用的代码
- (void)connectionDidFinishLoading:(NSURLConnection *)theConnection {
NSError *error = nil;
id response = [NSJSONSerialization JSONObjectWithData:responseData options:nil error:&error];
[responseData release];
if (error) {
NSLog(@"ERROR JSON PARSING : %@", error.localizedDescription);
}
[delegate databaseUpdates:response connection:self];
}
- (void)databaseUpdates:(id)_updates connection:(URLConnection *)_urlConnection {
if (_updates) {
NSDictionary *updates = nil;
@autoreleasepool {
updates = [[_updates valueForKey:@"objects"] retain];
//Release _updates here!?!
}
}
}
非常感谢
【问题讨论】:
标签: objective-c autorelease nsautoreleasepool nsjsonserialization