insertObject:in<myManagedObject>AtIndex:

  • Heyas,

    Am going through Hillegass' book boning up on bindings and such, and
    am doing the undo stuff with bindings where I wrote a
    insertObject:inEmployeesAtIndex: and removeObjectFromEmployeesAtIndex:
    method.

    Ok so that is fine and dandy, I read through the cocoa bindings docs,
    but I can't for the life of me find where this magic formula for
    insert: and remove: is to know that I could even write these methods
    in the first place.

    Anyone have a better pointer?  This is the kind of magic that makes
    bindings so confusing :)

    Thanks!
  • On Oct 20, 2007, at 4:01 AM, Steven W Riggins wrote:

    > Am going through Hillegass' book boning up on bindings and such,
    > and am doing the undo stuff with bindings where I wrote a
    > insertObject:inEmployeesAtIndex: and
    > removeObjectFromEmployeesAtIndex: method.
    >
    > Ok so that is fine and dandy, I read through the cocoa bindings
    > docs, but I can't for the life of me find where this magic formula
    > for insert: and remove: is to know that I could even write these
    > methods in the first place.
    >
    > Anyone have a better pointer?  This is the kind of magic that makes
    > bindings so confusing :)

    Read the Key-Value Coding Programming Guide:
    <http://developer.apple.com/documentation/Cocoa/Conceptual/
    KeyValueCoding/index.html
    >

    For an answer for this particular question, see:
    <http://developer.apple.com/documentation/Cocoa/Conceptual/
    KeyValueCoding/Concepts/AccessorConventions.html#//apple_ref/doc/uid/
    20002174-178830-BAJEDEFB
    >
  • Thanks!  I actually found that like 10 mins after I posted it,
    replied, to myself of course, sigh. :)

    I guess the trick to bindings is finding very good tutorials, like
    Aaron's book, that make you ask the questions, vs wading through all
    of those docs trying to gleam how all of that can be useful.

    Steve

    On Oct 20, 2007, at 5:56 AM, Michael Babin wrote:

    > On Oct 20, 2007, at 4:01 AM, Steven W Riggins wrote:
    >
    >> Am going through Hillegass' book boning up on bindings and such,
    >> and am doing the undo stuff with bindings where I wrote a
    >> insertObject:inEmployeesAtIndex: and
    >> removeObjectFromEmployeesAtIndex: method.
    >>
    >> Ok so that is fine and dandy, I read through the cocoa bindings
    >> docs, but I can't for the life of me find where this magic formula
    >> for insert: and remove: is to know that I could even write these
    >> methods in the first place.
    >>
    >> Anyone have a better pointer?  This is the kind of magic that makes
    >> bindings so confusing :)
    >
    > Read the Key-Value Coding Programming Guide:
    > <http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/in
    dex.html
    > >
    > >
    >
    >
  • On 20-Oct-07, at 3:01 AM, Steven W Riggins wrote:

    > Heyas,
    >
    > Am going through Hillegass' book boning up on bindings and such, and
    > am doing the undo stuff with bindings where I wrote a
    > insertObject:inEmployeesAtIndex: and
    > removeObjectFromEmployeesAtIndex: method.
    >
    > Ok so that is fine and dandy, I read through the cocoa bindings
    > docs, but I can't for the life of me find where this magic formula
    > for insert: and remove: is to know that I could even write these
    > methods in the first place.
    >
    > Anyone have a better pointer?  This is the kind of magic that makes
    > bindings so confusing :)
    >
    > Thanks!

    Apart from the page Michael referenced, there are additional and more
    detailed comments for the methods -valueForKey: and -setValue:forKey:
    in NSKeyValueCoding.h; these comments also detail how to implement
    NSSet properties.  This information should certainly be made available
    in the documentation and you may want to use Apple's feedback
    mechanism at the bottom of each page to help them make it more
    accessible...

    dave
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today