• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
bindings confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bindings confusion


  • Subject: bindings confusion
  • From: Torsten Curdt <email@hidden>
  • Date: Tue, 20 Sep 2011 11:13:31 +0200

Before I was following the docs and wrote the bindings clue code myself

 http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html#//apple_ref/doc/uid/20002373

    - (void)bind:(NSString *)binding toObject:(id)theObservedObject
withKeyPath:(NSString *)theKeyPath options:(NSDictionary *)options
    {
       ...
       self.observedObject = theObservedObject;
       self.observedKeyPath = theKeyPath;

       [theObservedObject addObserver:self
                           forKeyPath:theKeyPath
                              options:NSKeyValueObservingOptionInitial
                              context:nil];
       ...
    }


Now I have found these posts suggesting that it is not required to (or
even one should not) override bind:toObject:withKeyPath:options:

 http://www.tomdalling.com/blog/cocoa/implementing-your-own-cocoa-bindings
 http://stackoverflow.com/questions/1169097/can-you-manually-implement-cocoa-bindings
 http://stackoverflow.com/questions/366938/is-it-necessary-to-override-bindtoobjectwithkeypathoptions-in-an-nsview-subcl/

But I see myself in the same camp:

When I don't override bind:toObject:withKeyPath:options: my custom
NSView's bindings do not work.

Could someone clear this up?

cheers,
Torsten
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: bindings confusion
      • From: Quincey Morris <email@hidden>
    • Re: bindings confusion
      • From: Lee Ann Rucker <email@hidden>
  • Prev by Date: Re: Find panel problems
  • Next by Date: How to replace occurrences of a pattern with a NSAttributedString
  • Previous by thread: Re: Sandboxing and file references
  • Next by thread: Re: bindings confusion
  • Index(es):
    • Date
    • Thread