我用NSNumber为key,然后插入一个对象到NSMutableDictionary中:
NSNumber * key = [NSNumber numberWithInt:tmpWheel.WheelId]; [allWheels setObject:tmpWheel forKey:key];
然后我在其他地方用遍历这个NSMutableDictionary
for (NSNumber * key in [allWheels allKeys]) { NSLog(@"key : %@", key); Wheels * tmpWheel = [allWheels objectForKey:key]; NSLog(@"value : %@",tmpWheel.WheelName); }
竟然是null,拿不出value,我无语。什么原因??
MMTTMM
米脂
相关分类