3
我讀到GCD的文章,並有一個例子:Autoreleasepool和dispatch_async
dispatch_queue_t bgQueue = myQueue;
dispatch_async(dispatch_get_main_queue(), ^{
NSString *stringValue = [[[textField stringValue] copy] autorelease];
dispatch_async(bgQueue, ^{
// use stringValue in the background now
});
});
如果我把在單擊處理程序(將在autoreleasepool調用)方法,將我虧stringValue的,因爲點擊事件後,autoreleasepool會被銷燬?
現在有道理,謝謝 – INs