[Adium-devl] Plugin: Unable to add method to AIPreferenceController using category
George Armah
armahg at gmail.com
Thu May 24 16:28:37 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
>
I'm also new to Adium / Objective C.
I know this has already been mentioned but have you checked that your
Header Search Paths
setting under Project ->Edit Active Target "Yourpluginname" is correctly
set?
This was one of my main problems when starting out.
As a side note I am able to have both
#import <Adium/AIPreferenceControllerProtocol.h>
#import "AIPreferenceController.h"
in the file GASendEmailSMSPlugin.m and I get no build errors (my Header
search paths is ~/adium/Source)
Out of curiosity how are you planning to override the
-userPreferredDownloadFolder method? Are you going to override it (by
mangling) to
add an extra "sender" parameter?
From your description you want the user's download folder to become
sender-specific, have you considered looking into the
AIFileTransferControllerProtocol.h and the ESFileTransferController
class to do the customization of the download folder when the file
transfer happens?
It might be worth a try.
George Armah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070524/47240393/attachment-0001.html>
More information about the devel
mailing list