• 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
running code when all notifications have been processed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

running code when all notifications have been processed?


  • Subject: running code when all notifications have been processed?
  • From: Joshua Scott Emmons <email@hidden>
  • Date: Fri, 17 Feb 2006 16:29:44 -0600

I have a view that contains a variable number of smaller subviews. These subviews all change their size and appearance in response to a notification that is posted by my model. After the subviews have all updated themselves, their superview needs to arrange them. Right now I have something like the following in the subview:

-(void)modelChanged:(NSNotification *)notification{
	//do stuff

	[superview arrangeMySubviews];
}


This works, but has the obvious disadvantage that it calls the superview's arrangeMySubviews once for EACH subview that processes this notification. What should really happen is that arrangeMySubviews should be called only once after all the subviews have received and processed their notifications. Is there a way to be notified when all the objects sent a notification have processed it? Or is there a mechanism that will let me queue up many duplicate selectors, only sending the final message once?



Many thanks, -Joshua Emmons _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: running code when all notifications have been processed?
      • From: "Julien Jalon" <email@hidden>
  • Prev by Date: NSTableView with NSComboBoxCells
  • Next by Date: Using NSDateFormatter, and sorting issues
  • Previous by thread: Re: NSTableView with NSComboBoxCells
  • Next by thread: Re: running code when all notifications have been processed?
  • Index(es):
    • Date
    • Thread