KVC Conventions?

Discussion in 'Mac Programming' started by grimreaper1377, Apr 24, 2009.

  1. grimreaper1377 macrumors regular

    Joined:
    Oct 20, 2007
    #1
    Hi,

    I'm working my way though the 3rd edition of Hillegass' book and I'm on chapter 9 where he talks about adding undo to the raiseman application. However, I'm confused about the examples he gives for kvc conventions. For example,

    Code:
    id arrayProxy = [playlist mutableArrayValueForKey:@"songs"];
    
    int x = [arrayProxy count]; // is the same as
    int x = [playlist countOfSongs]; // if countOfSongs exists
    
    id y = [arrayProxy objectAtIndex:5] // is the same as
    id y = [playlist objectInSongsAtIndex:5]; // if the method exists
    
    [arrayProxy insertObject:p atIndex:4] // is the same as
    [playlist insertObject:p inSongsAtIndex:4]; // if the method exists
    
    [arrayProxy removeObjectAtIndex:3] // is the same as
    [playlist removeObjectFromSongsAtIndex:3] // if the method exists
    
    Are these conventions in apple's documentation?
     

Share This Page