在使用NSMutableDictionary的时候经常会使用setValue forKey与setObject forKey,他们经常是可以交互使用的,代码中经常每一种的使用都有. 1,先看看setValue: forKey:的定义 @interface NSMutableDictionary(NSKeyValueCoding) /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case s…
对于- (void)setValue:(id)value forKey:(NSString *)key;函数 官方解释如下 Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObject:forKey: 这就很明确的说明了setValue:forKey:中value能够为nil,但是当value为nil的时候,会自动调用removeObject:forKey方法,…
在NSMutableDictionary的方法中有setValue forKey与setObject forKey,它们都可以用来设置某一个key值对应的value 1,setValue: forKey: @interface NSMutableDictionary(NSKeyValueCoding) /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObj…
在使用NSMutableDictionary的时候经常会使用setValue forKey与setObject forKey,他们经常是可以交互使用的,代码中经常每一种的使用都有. 1,先看看setValue: forKey:的定义 @interface NSMutableDictionary(NSKeyValueCoding) /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case s…
在使用NSMutableDictionary 的时候经常会使用setValue forKey 与 setObject forKey,他们经常是可以交互使用的. 1.setValue forKey的定义 @interface NSMutableDictionary(NSKeyValueCoding) /* Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObjec…
iOS Programming NSUserDefaults When you start an app for the first time, it uses its factory settings. As you use it, a good app learns your preferences. Where are your preferences stored? Inside each app bundle there is a plist that holds the user'…