including growl support (for dummies)

The Growl forums have moved to Google Groups, this forum is read only.
Locked
ecume
Harmless
Posts: 4
Joined: Wed Mar 29, 2006 5:50 pm

including growl support (for dummies)

Post 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
User avatar
evands
Cocoaforge Admin
Posts: 3152
Joined: Thu Dec 02, 2004 10:55 pm
Location: Decatur, GA
Contact:

Post 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?
The duck still burns.
--
My company: Saltatory Software. Check it out :)
ecume
Harmless
Posts: 4
Joined: Wed Mar 29, 2006 5:50 pm

Post 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.
ecume
Harmless
Posts: 4
Joined: Wed Mar 29, 2006 5:50 pm

partial workaround

Post 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
User avatar
evands
Cocoaforge Admin
Posts: 3152
Joined: Thu Dec 02, 2004 10:55 pm
Location: Decatur, GA
Contact:

Post 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
The duck still burns.
--
My company: Saltatory Software. Check it out :)
ecume
Harmless
Posts: 4
Joined: Wed Mar 29, 2006 5:50 pm

what should the frameworks path be?

Post 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?
Locked