Re: Is this an incorrect use of categories ?
Re: Is this an incorrect use of categories ?
- Subject: Re: Is this an incorrect use of categories ?
- From: Graham Cox <email@hidden>
- Date: Fri, 06 Jul 2012 14:24:10 +1000
On 06/07/2012, at 1:54 PM, Erik Stainsby wrote:
> Is it sufficient that the categories be loaded in the windowController code? Or do they need to be available in the framework context in which the plugins are actually loaded from nib? That is, my categories are being added in the app not in the framework.
It would normally be sufficient, but I think you might be running into a load order issue.
Is this right?: You have a class 'MyClass' defined by a plug-in, and a category 'MyClass (ExtraStuff)' defined by your app.
If so, I don't think that will work. When your app is loaded and linked when it's launched, the category won't be attached to the class 'MyClass' because it doesn't exist. It is only loaded and linked when the plug-in is loaded, but the runtime can't retrospectively attach the category - its opportunity to do so automatically has passed. You might be able to use the low-level runtime methods to attempt to reattach the category after you have loaded the plug-ins.
Or it might be better to rethink how you're doing this so it's not so dependent on load order.
(Of course, I may have totally misread the situation).
--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