Reputation: 3192
Did KVC pick up any of the features of objective-c literals a.k.a. 'modern objective-c'
I'm wondering because it would be really handy if there were something far shorter, and more readable than
[someObject setValue:someValue forKey:someKey];
Upvotes: 1
Views: 73
Reputation: 16660
Object subscription is close to KVC:
someObject[someKey]=someValue;
Please note, that object subscription and KVC follows different code paths, so it is possible that the behavior is not the same. However, there is little reason for that.
Beside this one might doubt, if this is the clearer syntax:
object[@"a"]=object[@"b"]=object[@"c"];
Which messages are sent?
Upvotes: 2
Reputation: 5698
Probably same as you, I was unable to find any information on that
But I think the issue with KVC following "modern objective-c" is that the compiler wouldn't have any way to tell if you referenced a variable that's out of scope, or if you misspelled something.
So I think KVC will always have to follow the standard message syntax
Upvotes: 0