0
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
self.listFeedConnection = nil; // release our connection
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
// create the queue to run our ParseOperation
self.queue = [[NSOperationQueue alloc] init];
// create an ParseOperation (NSOperation subclass) to parse the RSS feed data so that the UI is not blocked
// "ownership of mediaListData has been transferred to the parse operation and should no longer be
// referenced in this thread.
//
ParseOperation *parser = [[ParseOperation alloc] initWithData:listData delegate:self];
[queue addOperation:parser]; // this will start the "ParseOperation"
[parser release];
[queue release];
// ownership of mediaListData has been transferred to the parse operation
// and should no longer be referenced in this thread
self.listData = nil;
}
- (void)dealloc
{
[records release];
[listFeedConnection release];
[listData release];
[queue release];
[super dealloc];
}
道歉 - 我得到NSOperationQueue上的錯誤。顯然沒有正確釋放。請指教。 – user1470105
錯誤究竟是什麼? 「顯然沒有正確發佈」是什麼意思? –
NSOperationQueue 1.方法返回帶有+1保留計數的Objective-C對象。 然後在解析器代碼2.對象泄漏:稍後未引用的分配的對象。 – user1470105