KVC simple path vs compound path

Discussion in 'iOS Programming' started by HARDWARRIOR, Apr 16, 2009.

  1. macrumors member

    Joined:
    Nov 17, 2008
    #1
    Hi
    According to Apple's article about KVC http://developer.apple.com/document.../KeyValueCoding/Concepts/BasicPrinciples.html paths for valueForKey can be compound. I mean consist from several property names separated by dot.
    So if I want to get value of property of an object inside of one of it's accessors, than I can use
    Code:
    [self.someproperty valueForKey:@"somevalue"];
    or
    Code:
    [self valueForKey:@"someproperty.somevalue"];
    But second does not work! It says "this class is not key value coding-compliant for the key". So what is the problem with compound key path?
     

Share This Page