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
including growl support (for dummies)
- evands
- Cocoaforge Admin
- Posts: 3152
- Joined: Thu Dec 02, 2004 10:55 pm
- Location: Decatur, GA
- Contact:
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
at the top of your implementation file to import the Growl headers?
Do you have
Code: Select all
#import <Growl/Growl.h>
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.
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
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
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
what should the frameworks path be?
what should the frameworks path be (literally what should I type in the field) if I want it to reference the main project directory?