• 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: NSView confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView confusion


  • Subject: Re: NSView confusion
  • From: Graham Cox <email@hidden>
  • Date: Tue, 19 Aug 2008 15:32:44 +1000


On 19 Aug 2008, at 9:02 am, Charlie Dickman wrote:

Also, how does one synchronize events with the update of the various views? I can instruct each view what to draw and it draws it just fine (I use lockFocus, etc. when drawing is external to drawRect) and the updated view is seen _eventually_ but I can not synchronize subsequent activity to happen after the appropriate display is seen. How can I accomplish this synchronization? And how can I force a view to update? Invoking [view display] has no effect on forcing the display toshow the latest update.

In my experience it's rarely necessary to "force" a view to update. Just mark it as needing update (-setNeedsDisplay:, - setNeedsDisplayInRect:) and let it handle it in due course. It sounds like you're trying to do its job for it, though hard to be sure from your description. It's also not really clear why synchronisation is needed, or what you're trying to accomplish. Again, the need to "synchronise" views sets off alarm bells - rarely needed and maybe indicative of the need to revise your design. If there is a data model common to the views make it a separate object, apply changes there, tell the views they need to update and voila! - all views show the new state. Do not keep state/model data in a view unless your app is trivial and it's the only view (and even then it's probably a bad idea).


hth,

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: 
 >NSView confusion (From: Charlie Dickman <email@hidden>)

  • Prev by Date: Re: Shared NSTextView
  • Next by Date: Re: Right place to unobserve notifications in a document
  • Previous by thread: Re: NSView confusion
  • Next by thread: NSView confusion
  • Index(es):
    • Date
    • Thread