Just that--I'm a newbie and I don't know which one to use in any situation.
Asked
Active
Viewed 1,747 times
-1
-
Dupcicle: http://stackoverflow.com/questions/1249634/wheres-the-difference-between-setobjectforkey-and-setvalueforkey-in-nsmutab – Richard J. Ross III Aug 02 '12 at 14:17
1 Answers
8
There is no difference because neither exists for a NSMutableArray
.
However, those methods exist for NSMutableDictionary
. The difference between the 2 is this:
From apple: NSMutableDictionary
-setValue:forKey:
This method adds value and key to the dictionary using setObject:forKey:, unless value is nil in which case the method instead attempts to remove key using removeObjectForKey:.

Richard J. Ross III
- 55,009
- 24
- 135
- 201

Jeremy
- 8,902
- 2
- 36
- 44
-
3Not sure what 'complete dupe' means. The above is quoted (and cited) from apple's website. Unless you intended to vote down the question. Cheers. – Jeremy Aug 02 '12 at 14:21
-
2@RichardJ.RossIII I followed your link and it's not a duplicate of any of the answers there. – JeremyP Aug 02 '12 at 15:40