我有以下代碼行奇怪的錯誤:iOS上
NSLog(@"deleted row");
if(contacts == nil) {
NSLog(@"contacts is nil");
}
NSLog(@"hi");
NSLog(@"contacts is %@",contacts);
在控制檯中,我看到deleted row
印刷,然後我看到hi
印刷,然後將其崩潰。變量contacts
是NSMutableArray
。如果它不是nil
,爲什麼我不能打印出來?爲什麼程序崩潰?
如果你消除最後一個NSLog它會崩潰嗎?你如何分配/初始化NSMutableArray – aherlambang 2011-05-30 16:00:36
你可以顯示代碼在哪裏分配數組 – dbslone 2011-05-30 16:01:23