• 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
Re: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)


  • Subject: Re: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 2 Jul 2009 15:42:55 -0700

On Thu, Jul 2, 2009 at 2:25 PM, Andy Lee<email@hidden> wrote:
> My first reaction was: "Elegantly put!"  But then I thought, isn't *not* generating this kind of code one of the reasons we tell people nibs are good?  Wouldn't a .m be a good place to "document" targets and actions as well?  And delegates and other outlets?  Or do you think there's something about bindings that makes them subtle enough that for *them*, in some cases, it might make sense to "document" them by coding them?

If you've decided that it will be better for the long-term health of
your application to document your bindings, it really isn't that hard
to do it in code rather than a text file.  I mean how is this:

nameTextField.value -> [Array Controller].arrangedObjects.name
|- Value Transformer: CapitalizeTransformer
|- Null Placeholder: <null>
|- Multiple values placeholder: <multiple selection>

all that different from this:

- (void)awakeFromNib {
  [nameTextField bind:@"value" toObject:arrayController
withKeyPath:@"arrangedObjects.name" options:
    [NSDictionary dictionaryWithObjectsAndKeys:
      @"CapitalizeTransformer", NSValueTransformerNameBindingOption,
      @"<null>", NSNullPlaceholderBindingOption,
      @"<multiple selection>", NSMultipleValuesPlaceholderBindingOption, nil]];
}

The important point is that your binding setup needs to get
complicated enough to warrant documentation in the first place -- from
there the extra effort required to get your documentation to compile
is trivial compared to the effort of documentation in the first place.
 Target-action setups rarely get this complicated; most of the time
you just wire up your controls to First Responder.

--Kyle Sluder
_______________________________________________

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

References: 
 >Dynamically loading a part of a Window in Cocoa (From: Debajit Adhikary <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: Thomas Davie <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: Quincey Morris <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: Quincey Morris <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: Marco S Hyman <email@hidden>)
 >Re: Dynamically loading a part of a Window in Cocoa (From: Michael Ash <email@hidden>)
 >documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa) (From: Andy Lee <email@hidden>)

  • Prev by Date: Changing content of object inside NSMutableArray
  • Next by Date: Re: Changing content of object inside NSMutableArray
  • Previous by thread: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)
  • Next by thread: Re: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)
  • Index(es):
    • Date
    • Thread