關於此發佈Why does 'self' protect memory space?,我使用'自我'訪問aArray。然而,我仍然在didSelectRowAtIndexPath:方法中得到一個無效的對象。即使對自己,對象仍然autoreleased
在根控制器,我訪問aArray這樣的:
MyAppDelegate *theDelegate = [[UIApplication sharedApplication] delegate];
NSString *aKey = [theDelegate.aArray objectAtIndex:0];
將有事可做與aArray失去其參考?爲什麼它不會出現在cellForRowAtIndexPath中:(第一次使用它在MyAppDelegate之外)?
是的 - 我正在運行Clang。索引零處的對象是有效的。 – 4thSpace 2009-09-30 16:39:41
正在使用「分配」而不是「保留」。沒有抓住它一段時間。問題解決了。 – 4thSpace 2009-10-01 01:35:43
所以我想不是過度釋放,而是保留不足。 – 2009-10-08 20:37:06