site_archiver@lists.apple.com Delivered-To: Pro-apps-dev@lists.apple.com On Aug 14, 2009, at 6:13 PM, Brian Gardner wrote: Good point, Steve. _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... It does sound like arrays were a bad idea. I do like Darrin's suggestion of using NSNotifications. Seems more stable. I'll assume that NSNotifications doesn't have a similar issue, and will work properly even if the particular clip isn't currently being directly worked on. (Is that a valid assumption?) I don't remember offhand if NSNotificationCenter retains notification observers or not. I would suppose that it would so it doesn't walk off into the weeds if an observer were to go away without unregistering, but you should see if that is, indeed, the case. If it is you would need to figure out a way to make sure the instance is properly disposed. I'm not sure what you meant by "the particular clip isn't currently being directly worked on" part. If it's referring to making sure that the global settings are correctly propagated into plugin instances not yet created, or those that were hypothetically created at some point but have since been destroyed since they're not "being used," then, no, that won't happen because those instances don't exist at the time the notification is sent out. It may be that a better solution would be to have a dirty flag as an instance variable and mark all plugin instances as "dirty" when they're initialized so that the current global settings can be stuffed into the parameters when they're first created and/or replacing the "invalid" parameter value(s) with the current "good" ones from the singleton. Note that this still does not address how the singleton gets the "good" values in the first place. This makes the assumption that a plugin instance is created for each clip that uses your effect and that the instance will hang around in memory until either that clip is removed, the project is closed or the host app quits. I don't know the underlying architecture but it's just as likely that plugin instances are created as needed and then destroyed if you're not currently working with a particular clip. If you create an array and add instances to it, you -could- end up with a bunch of stale items that no longer refer to real clips and/ or conflict with the plugin instance that now manages your effect for a particular clip. ... steve This email sent to site_archiver@lists.apple.com