草庐IT

planetDictionary

全部标签

iphone - 无法从 for-in 循环中更新 NSMutableDictionary 值?

我在更新NSMutableDictionary值时遇到了一个奇怪的问题。我正在运行一个for-in循环,所有内容都可以正常检索,而且我的数学也很好。问题出在我尝试使用setValue:forKey:方法更新我的字典时。for(NSString*keyinself.planetDictionary){if(![keyisEqualToString:planet]){***//dosomemathandstuff,createanNSNumber:NSNumber*update=[NSNumbernumberWithFloat:updatedProbability];//Problemco