|May 6, 2006, 11:56 PM||#1|
Simple NSMutableDictionary Question
What is the difference between these two methods:
- (void)setObject:(id)anObject forKey:(id)aKey - (void)setValue:(id)value forKey:(NSString *)key
I am the MacRumoron
Click Here For Proof Told you I'm a moron..
|May 7, 2006, 12:10 AM||#2|
The main difference is that setValue will accept a nil parameter for the object value (in which case it will remove the key from the dictionary), but setObject won't (it will throw an exception). Also, setValue will only work in Mac OS X 10.3 and higher while setObject works in older versions of Mac OS X. Other than that, they're essentially the same (in fact setValue just calls setObject after checking for a nil parameter).
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Modify a key-value pair of an NSMutableDictionary that is represented by an NSData||moonman239||iPhone/iPad Programming||1||May 2, 2014 01:56 PM|
|Simple Question Apple TV [ Thanks ]||icloud87||Apple TV and Home Theater||10||Mar 5, 2014 06:29 PM|
|Simple question??||davidra||Apple TV and Home Theater||5||Jan 21, 2014 01:19 PM|
|NSMutableDictionary and a button to send changes||Carll||iPhone/iPad Programming||12||Jan 12, 2013 08:19 AM|
|Resolved: Fetch object in NSMutableDictionary inside NSMutable||lasash||iPhone/iPad Programming||22||Oct 9, 2012 09:10 PM|
All times are GMT -5. The time now is 12:24 AM.