[Adium-devl] Plugin: Unable to add method to AIPreferenceController using category

Henrik Nyh henrik at nyh.se
Thu May 24 15:11:10 UTC 2007


On 24/05/07, Graham Booker <gbooker at cod3r.com> wrote:
>
> On May 24, 2007, at 8:56 AM, Henrik Nyh wrote:
>
> > On 24/05/07, Evan Schoenberg <evan at adiumx.com> wrote:
> >>
> >> On May 24, 2007, at 9:22 AM, Ofri Wolfus wrote:
> >>>  If #import <Adium/AIPreferenceController.h> can't find the
> >>> header how come the other #imports do?
> >> This should be #import
> >> <Adium/AIPreferenceControllerProtocol.h>.  The header for
> >> AIPreferenceController itself is not public.
> >
> > If I just import <Adium/AIPreferenceControllerProtocol.h>, I get
> > "error: cannot find interface declaration for
> > 'AIPreferenceController'". Small test case for this (as
> > "FileTransferFoldersPerSenderPlugin.m"):
> >
> >
>
> I think that categories need to see the interface declaration because
> selectors inside a category can use instance and class variables.  As
> such, the compiler needs to see the interface so it can check the
> validity of these references.
>
> You can probably get away with
> #import "Source/AIPreferenceController.h"
> or something like it.  Try to see if you can get it to work with a
> relative path.

Well, "../adium-1.0.2/Source/AIPreferenceController.h" works, but I
don't see that it should make any difference whether I use an absolute
or relative path for that.

> >> No idea why your category
> >> isn't working.  You said you've tried directly swizzling the
> >> method, too?
> >
> > Haven't tried swizzling yet, since I planned to add a method with a
> > category and then swizzle. Since I can't get adding the method to
> > work, I haven't gone further.
> >
>
> AIPreferenceController is part of adium itself, so it should be
> loaded well before your plugin.  I don't know why your category isn't
> working properly.  Maybe Ofri is right in that you may have a
> duplicate AIPreferenceController in your plugin.  There is an option
> (somewhere, can't remember what it is), to have your plugin link
> against an executable, so that you use its symbols, and not your own
> (for code it has).  If you enable this, make sure you don't suppress
> undefined and the like.

I'd try this, but I've no idea where that option is either, or just
how I'd configure it.




More information about the devel mailing list