Re: calling a function in one class from another
Re: calling a function in one class from another
- Subject: Re: calling a function in one class from another
- From: Graham Cox <email@hidden>
- Date: Tue, 10 Aug 2010 12:28:18 +1000
On 10/08/2010, at 7:13 AM, Geoffrey Holden wrote:
> On a related note, how does this relate to plugin bundles? I've created a plugin (using the tutorial in Aaron Hillegass's excellent book) - and it works perfectly. I want to be able to respond to events in the plugin though - would IBAction be the best way to do this since there doesn't seem to be a way of getting the App to be a delegate for one of its plugins?
What do you mean by 'events'? Actual events, such as mouse down, key strokes, that sort of thing? Or do you really mean 'actions', which are responders to button clicks, menu choices, etc.
IBActions are useful for the latter. Events are a lower level concept (for example, a mouse down, mouse drag and mouse up could be a whole series of events that a button responds to, but which trigger one action, which informs the button's controller that the button was "clicked"). Actions are typically used to connect a user interface item to a controller that gives that user interface item some functional meaning by manipulating the data model appropriately.
A plug-in is not restricted as to what sort of UI it can present. You typically don't want the app (or its delegate) to be a controller on behalf of a plug-in's UI. It's not actually impossible but it's a crazy design, so I'm glad you think it is impossible! A plug-in can have a nib or nibs that provide a user interface just as the app can. How the plug-in interfaces to the app itself is up to you, but this should be happening at the controller or data-model level, not the UI. Other than that there's not much advice to give, given that I don't know anything about what your app or its plugins do.
--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