0

在NSDictionary中複製密鑰後,我得到一個崩潰。我正在使用ARC。是什麼原因?NSDictionary mutableCopy引發exc_bad_access

-(NSArray*) findClosestPointsAroundPoint: (NSDictionary*) p inTable: (NSString*) table { 

NSMutableArray* fields = [[p allKeys] mutableCopy];} 

(gdb) po table 
0xef7b880 does not appear to point to a valid object. 

回答

0

想必table尚未設置,或已被設置爲一零值。嘗試NSLog(@"TABLE ->%@"<- TABLE, table);以查看table的值。