Page 1 of 1

including growl support (for dummies)

Posted: Wed Mar 29, 2006 5:56 pm
by ecume
I'm trying to add growl support into my cocoa app and there is obviously something I am not doing and which is not explicitely stated in the docs.

I download the framework and add it to my cocoa project in xcode.
I add the copy files build phase and add the framework to that.
I pop in the framework loading code:

//load Growl framework
NSBundle *myBundle = [NSBundle bundleForClass:[self class]];
NSString *growlPath = [[myBundle privateFrameworksPath]
stringByAppendingPathComponent:@"Growl.framework"];
NSBundle *growlBundle = [NSBundle bundleWithPath:growlPath];
if (growlBundle && [growlBundle load]) {
// Register ourselves as a Growl delegate
[GrowlApplicationBridge setGrowlDelegate:self];
} else {
NSLog(@"Could not load Growl.framework");
}

I implement - (NSDictionary *) registrationDictionaryForGrowl;


I build the app and get the build errors that GrowlApplicationBridge is not declared. Not having a great deal of experience with custom frameworks - what else do I have to do to make my app aware of the new headers in the framework?

-ecume

Posted: Wed Mar 29, 2006 7:05 pm
by evands
Are you using a loadable bundle such that you need to explicitly load the framework bundle like that? If you have a simple Cocoa app, linking against the framework as described in the documentation (in the paragraph above the code you show on http://growl.info/documentation/develop ... lang=cocoa) is easier.

Do you have

Code: Select all

#import <Growl/Growl.h>
at the top of your implementation file to import the Growl headers?

Posted: Wed Mar 29, 2006 7:35 pm
by ecume
yes - I have #import <Growl/Growl.h> in the header file.

the compiler can't find it, however: Growl/Growl.h: No such file or directory

other variables: I am using the precompiled framework from the SDK. I am compiling my app as a universal binary. I am using XCode 2.2.1 When I add the framework I choose Rference Type: default, Text Encoding: UTF-8 encoding.

partial workaround

Posted: Mon Apr 03, 2006 4:18 pm
by ecume
I got it to work by mounting the sdk dmg :-/

somehow xcode 'remembered' the original path to the framework from when i first dragged it into the project. Subsequent attempts to load the framework from inside the project directory never worked as it was always looking for it on the virtual device created when the dmg was mounted.

Now I can't find any way in the project settings or target settings to flush this memorized path and give it a new one.

grrrrr

Posted: Mon Apr 03, 2006 4:48 pm
by evands
1) Check your Framework Search Paths in the target and project build settings
2) Delete the framework from where you dragged it to originally; drag it in from its proper location

what should the frameworks path be?

Posted: Mon Apr 17, 2006 4:10 pm
by ecume
what should the frameworks path be (literally what should I type in the field) if I want it to reference the main project directory?