discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with my first app


From: Pierre-Yves Rivaille
Subject: Re: Problem with my first app
Date: Sat, 13 Oct 2001 15:05:56 +0200 (MET DST)

I don't have the exact same error messages as you, probably because I'm
using gcc 3.0.2. But :

> #include <Foundation/Foundation.h>
> #include <AppKit/AppKit.h>
> 
> @interface MyDelegate : NSObject
> - (void) applicationWillFinishLaunching: (NSNotification *)not;
> @end
> 
> @implementation MyDelegate : NSObject

should be 

  @implementation MyDelegate

because inheritance is only specified in the @interface part.


> - (void) applicationWillFinishLaunching: (NSNotification *)not
> {
>   NSMenu *menu;  
>   menu = AUTORELEASE ([NSMenu New]); 

should be 
  menu = AUTORELEASE ([NSMenu new]); 

>   [menu addItemWithTitle: @"Quit" 
>    action: @selector (terminate:)
>    keyEquivalent: @"q"];
>   [NSApp setMainMenu : menu];
> }
> @end
> 
> int main(int argc, const char **argv)
> {
>       [NSApplication sharedApplication];
>       [NSApp setDelegate: [MyDelegate new]];
>       
>       return NSApplicationMain (argc, argv);
> }

        Pierre-Yves




reply via email to

[Prev in Thread] Current Thread [Next in Thread]