Reputation: 535
Is there any difference between the methods setObject:forKey
and setObject:forKeyedSubscript
?
I am using an Objective-C NSMutableArray
. Both seem to function the same way to me.
Upvotes: 2
Views: 1588
Reputation: 57050
setObject:forKeyedSubscript:
and setObject:atIndexedSubscript:
are used for mutable collection subscripting methods, introduced with the Objective C Literals.
setObject:forKeyedSubscript:
is used for dictionary-styled mutable collections. You should not use it with array-style collections.
More info here.
Upvotes: 5
Reputation: 52592
Documentation says:
"This method is identical to setObject:forKey:".
Upvotes: 0