0
我有一個UITableViewController,我用Web服務填充數據。數據下載時我使用NSInvocationOperation和NSOperationQueue在後臺線程上運行Web服務調用,同時在UI上顯示進度指示器。這一切都很好,但我只是想確保我正確處理對象。我的代碼如下:iPhone上的Objective-C - 使用NSOperationQueue和NSInvocationOperation
NSOperationQueue *backgroundTaskQueue = [[NSOperationQueue alloc] init];
NSInvocationOperation *webServiceOp = [[NSInvocationOperation alloc]
initWithTarget:self
selector:@selector(loadListDataOperation)
object:nil];
[backgroundTaskQueue addOperation:webServiceOp];
[webServiceOp release];
我的內存管理知識告訴我,我應該在某個時候釋放backgroundTaskQueue但不知道在哪裏 - 它應該只是在的UITableViewController的的dealloc()方法?
讚賞任何幫助,
喬納森
非常感謝,只是想確定。 – 2012-03-01 11:29:33