• 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: Design Question: Bindings & Custom Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Design Question: Bindings & Custom Views


  • Subject: Re: Design Question: Bindings & Custom Views
  • From: Graham Cox <email@hidden>
  • Date: Thu, 28 Aug 2008 21:38:05 +1000


On 28 Aug 2008, at 6:15 pm, Oleg Krupnov wrote:

I have only one problem with this approach: As I mentioned before, I
need to add custom-view specific instance variables (states) to the
model object's category. The Objective-C categories do not allow
adding instance variables, only methods

I am considering to create a dictionary owned by the custom view,
containing state objects keyed by model object unique ID. This is a
kind of surrogate of subclassing the model objects inside the custom
view. I am not sure this is a good idea though. Are there other
approaches?


This doesn't sound, er... sound.

What "custom-view specific variables" are you talking about? If there really are variables that are part of the view's state, then they should be part of the view. If they are part of the model's state they should be part of the model. Or perhaps they are really neither and should in fact be part of a controller that mediates between one and the other. I've not come across the need to do what you're apparently leaning towards when using a conventional MVC approach.

Maybe a bit more context regarding your particular needs would help.

cheers, Graham
_______________________________________________

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: 
 >Design Question: Bindings & Custom Views (From: "Oleg Krupnov" <email@hidden>)
 >Re: Design Question: Bindings & Custom Views (From: "Oleg Krupnov" <email@hidden>)

  • Prev by Date: Re: Quitting all active applications
  • Next by Date: NSMutableDictionary, NSNumber and more memory management
  • Previous by thread: Re: Design Question: Bindings & Custom Views
  • Next by thread: Re: Design Question: Bindings & Custom Views
  • Index(es):
    • Date
    • Thread