Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

running code when all notifications have been processed?



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: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.