Re: Subclass NSApplication in Carbon App?
Re: Subclass NSApplication in Carbon App?
- Subject: Re: Subclass NSApplication in Carbon App?
- From: Finlay Dobbie <email@hidden>
- Date: Mon, 31 May 2004 23:51:14 +0100
On 31 May 2004, at 22:58, David Bainbridge wrote:
I came up with the following solution:
#import "/usr/include/objc/objc.h"
#import "/usr/include/objc/objc-class.h"
#import "/usr/include/objc/objc-runtime.h"
((struct objc_class *) NSApp)->isa = [MyApp class];
Any problems with doing this?
Your ivars may not work properly, NSApp will only be the size of
NSApplication not MyApp. Try [MyApp poseAsClass:[NSApplication class]]
before NSApplicationLoad, which is still a bit of a hack but not such
an evil one.
-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.