• 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: Where in the MVC should my code go?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where in the MVC should my code go?


  • Subject: Re: Where in the MVC should my code go?
  • From: Jean-Henri Duteau <email@hidden>
  • Date: Mon, 1 Mar 2010 15:57:24 -0800

On 2010-03-01, at 3:20 PM, Chase Meadors wrote:

> 2. On the other hand, if you want the view to be more independent and
> flexible as according to MVC, you have more options. If you're binding
> the model to the view, you can simply use a custom NSValueTransformer
> class to change your model attribute to an array of strings. Or you
> can simply factor the code into the view controller in any way you wish.

In the end, that's what I ended up doing.  I created a Value Transformer and in my ViewController, registered the 15 different instances of the transfomer and gave them different names.  This ends up being the best separation of concerns - neither the view nor the model know about these transformations and I have one class to consult to change the code.

Thanks to everyone who contributed suggestions.  The process of reading the responses and understanding them allowed me to finalize on my solution.

Jean_______________________________________________

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

  • Prev by Date: Re: XCode's Special Buttons
  • Next by Date: Re: Menu Items
  • Previous by thread: Re: Where in the MVC should my code go?
  • Next by thread: Catching double click (any mouse events) in an NSTableView
  • Index(es):
    • Date
    • Thread