App delegate in library isn't noticed

David Dunham dunham at mac.com
Thu Jan 24 09:29:25 PST 2008


On 23 Jan 2008, at 23:25, David Dunham wrote:

> I had a simple application working, with an application delegate  
> set up in its MainMenu.nib.
>
> I'm going to be using this in a number of applications, so I  
> created a Cocoa library (.a file) and put AppDelegate.m there  
> (instead of the simple application project). Now when I launch, I get
>
> Unknown class `AppDelegate' in nib file, using `NSObject' instead.
>
> I also have main() in the library, and this does work (and  
> successfully calls NSApplicationMain).
>
> How come it can find main() but not AppDelegate?


I added

AppDelegate*	a = [AppDelegate alloc];
[a release];

right before the call to NSApplicationMain, and it worked.

Are the Cocoa classes from the library getting stripped from the  
build? (The app is primarily C++.) I didn't see any settings that  
would do that.

David Dunham
Voice/Fax: 206 783 7404             http://www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein



More information about the MacOSX-dev mailing list