• 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: Objective-C++, class scope constants, name conflicts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C++, class scope constants, name conflicts


  • Subject: Re: Objective-C++, class scope constants, name conflicts
  • From: Chris Hanson <email@hidden>
  • Date: Sat, 11 Feb 2006 00:13:12 -0800

On Feb 10, 2006, at 5:34 PM, Scott Ribe wrote:

Of course the coupling is undesirable, but as far as I know, Cocoa offers me
NO WAY to change that number of controls in a nib without changing code in
my controller. (And it certainly doesn't offer me a path to add controls
without remembering to connect them all properly.)

It does: You can use bindings, or you can create your own bindings- like system that uses key paths and your own controller objects to connect your view with your model.


You call out checking groups of controls for valid data as a significant use case; you have said you don't want to write redundant code to do this. I would probably use bindings to connect my view and model objects, and implement key-value validation methods on my model objects as appropriate. That way the validation is happening at the model rather than the view level, and code-level coupling of view and model is minimized.

For one example, if I was going to present identical controls for several objects in a collection, I might create a custom view that knew how to interact with an array controller and present one set of controls for each object in the array controller's arranged objects.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Objective-C++, class scope constants, name conflicts
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Objective-C++, class scope constants, name conflicts (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Folder Icon?
  • Next by Date: Re: Accessing *other* applications' windows?
  • Previous by thread: Re: Objective-C++, class scope constants, name conflicts
  • Next by thread: Re: Objective-C++, class scope constants, name conflicts
  • Index(es):
    • Date
    • Thread