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

Graham Booker gbooker at cod3r.com
Thu May 24 14:59:12 UTC 2007


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.

>> 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.

> / H

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1603 bytes
Desc: not available
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070524/b1dab59c/attachment.p7s>


More information about the devel mailing list