• 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
Changing subviews during drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing subviews during drawing


  • Subject: Changing subviews during drawing
  • From: Drew McCormack <email@hidden>
  • Date: Tue, 30 Mar 2004 19:56:34 +0200

Can you safely change the subview of an NSView in its drawRect: method? I have been doing this for some time, but have now run into an EXC_BAD_ACCESS deep in the Cocoa framework during drawing, and I suspect changing the subview is indirectly causing the problem.

Assuming this is bad practice, where is the best place to lazily update an NSView? I have a plot class. When attributes of the plot change, it needs to be updated before it is redrawn. I have been doing this is in drawRect:, but updating the plot does require subviews to be changed, leading to the problem above. Is there a single NSView method, like display, where I could do this update before drawRect: is called?

Drew McCormack
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Changing subviews during drawing
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Distributed Objects pitfalls and strategies
  • Next by Date: [SOLVED] Re: NSHangOnUncaughtException does not work ?
  • Previous by thread: Re: Why does this keep sending EXC_BAD_ACCESS
  • Next by thread: Re: Changing subviews during drawing
  • Index(es):
    • Date
    • Thread