• 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: "Oleg Krupnov" <email@hidden>
  • Date: Thu, 28 Aug 2008 13:26:12 +0300

> I think there are times when it's appropriate to have wrapper objects - that
> are view related - for your model objects.  In an image browser, it's likely
> that there is a "thumbnail" object that draws "image" objects.

Yeah, maybe "view-related wrapper objects for model objects" is the right term.

In your image browser example, this problem sounds as follows: where
to store the cached thumbnail images, to avoid re-creating them anew
in each drawRect call? Also, if a thumbnail is in process of dragging
inside the custom view, where to save the flag that the thumbnail
should be highlighted, the next time we draw it in drawRect?

I thought this kind of problem should be well-known and commonplace
among Cocoa developers...

> So maybe  your custom view creates "thumbnails" for the shapes it needs to
> draw and keeps the view-related properties and states in those objects -
> instead of adding them to the shape objects themselves?  It's a little crude
> - but from what I can understand about your problem - it could be a place
> for you to start separating the model and view in your design.

I am not sure I understood this phrase. Why is it crude? Anyway, I am
looking to solve the problem in the standard way, not reinvent
anything.


On Thu, Aug 28, 2008 at 1:03 PM, Cathy Shive <email@hidden> wrote:
>
> On Aug 28, 2008, at 11:06 AM, Oleg Krupnov wrote:
>
>> In other words, I need a way to associate additional
>> custom-view-specific properties with model object, without adding them
>> as transitive properties to the model. What is the best way to do
>> this? Or maybe your point is that this is a bad idea at all and such
>> problem should not arise, and I need to include everything in the
>> model? What is the standard workaround suggested in Cocoa?
>
> Hi Oleg,
>
>

>
> HTH,
> Cathy
>
>
>
>
>
>
>
>
>
>
>
>
_______________________________________________

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: Design Question: Bindings & Custom Views
      • From: Cathy Shive <email@hidden>
    • Re: Design Question: Bindings & Custom Views
      • From: Graham Cox <email@hidden>
References: 
 >Design Question: Bindings & Custom Views (From: "Oleg Krupnov" <email@hidden>)
 >Re: Design Question: Bindings & Custom Views (From: "Oleg Krupnov" <email@hidden>)
 >Re: Design Question: Bindings & Custom Views (From: Negm-Awad Amin <email@hidden>)
 >Re: Design Question: Bindings & Custom Views (From: "Oleg Krupnov" <email@hidden>)
 >Re: Design Question: Bindings & Custom Views (From: Cathy Shive <email@hidden>)

  • Prev by Date: Re: Creating Interface
  • Next by Date: Quitting all active applications
  • Previous by thread: Re: Design Question: Bindings & Custom Views
  • Next by thread: Re: Design Question: Bindings & Custom Views
  • Index(es):
    • Date
    • Thread