[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: an error from the expression: CLS_ISCLASS((Class)receiver) File: sen
From: |
David T. Shen |
Subject: |
Re: an error from the expression: CLS_ISCLASS((Class)receiver) File: sendmsg.c Line 321 |
Date: |
Fri, 13 Feb 2009 00:29:21 -0800 (PST) |
Thanks for your advise!
That's my fault, I think the application has build and that's OK, but
that's not OK actually. I'm not familiar with GNUStep's.
It's OK right now. thank you very much!
Fred Kiefer wrote:
>
> I don't understand this error message either. But you already should get
> some warnings during compilation. sharedApplicatiion is clearly
> misspelled and you should get this told by the compiler. Best you fix
> you compiler warnings and then report back with a bit more information.
>
> Fred
>
> David T. Shen wrote:
>> My platform is Windows XP, and I got a simple GUI program. It compiled
>> well, but when I run it, I got an error:
>> ---------------------
>> Assertion failed!
>>
>> File: sendmsg.c
>> Line: 321
>>
>> Expression: CLS_ISCLASS((Class)receiver)
>>
>> --------------------------------------
>> here is the code and makefile:
>>
>> //// AppController.h
>> #ifndef _APPController_H_
>> #define _APPController_H_
>>
>> #include <Foundation/NSObject.h>
>>
>> @class NSWindow;
>> @class NSTextField;
>> @class NSNotification;
>> @class NSMenu;
>>
>> @interface AppController:NSObject
>> {
>> NSWindow *window;
>> NSTextField *label;
>> }
>>
>> - (void) applicaitonWillFinishLaunching:(NSNotification *)not;
>> - (void) applicationDidFinishLaunching: (NSNotification *)not;
>>
>> @end
>>
>> #endif
>>
>>
>> -----------------
>> ///// AppController.m
>> #include "AppController.h"
>> #include <AppKit/AppKit.h>
>>
>> @implementation AppController
>>
>> -(void) applicationWillFinishLaunching:(NSNotification *)not
>> {
>> // create menu
>> NSMenu *menu;
>> NSMenu *info;
>>
>> menu = [NSMenu new];
>> [menu addItemWithTitle: @"Info"
>> action:NULL
>>
>> KeyEquivalent:@""];
>> [menu addItemWithTitle: @"Hide"
>>
>> action:@selector(hide:)
>>
>> KeyEquivalent:@"h"];
>> [menu addItemWithTitle : @"Quit"
>>
>> action:@selector(terminate:)
>>
>> KeyEquivalent:@"q"];
>>
>> info = [NSMenu new];
>>
>> [info addItemWithTitle : @"Info Panel..."
>>
>> action:@selector(orderFrontStandardInfoPanel:)
>>
>> KeyEquivalent:@""];
>>
>> [info addItemWithTitle : @"Performance"
>> action:NULL
>>
>> KeyEquivalent:@""];
>> [info addItemWithTitle : @"Help"
>>
>> action:@selector(orderFrontHelpPanel:)
>>
>> KeyEquivalent:@"?"];
>>
>> [menu setSubmenu: info
>> forItem:[menu
>> itemWithTitle:@"Info"]];
>>
>> RELEASE(info);
>>
>> [NSApp setMainMenu:menu];
>> RELEASE(menu);
>>
>> /**
>> * create window
>> **/
>> window = [[NSWindow alloc] initWithContentRect:
>> NSMakeRect(300,300,200,200)
>>
>>
>> styleMask:(NSTitledWindowMask|
>>
>>
>> NSMiniaturizableWindowMask|
>>
>>
>> NSResizableWindowMask)
>>
>> backing :
>> NSBackingStoreBuffered
>>
>> defer :
>> YES];
>> [window setTitle:@"Hello window"];
>>
>> /**
>> * Create Lable
>> **/
>> label = [[NSTextField alloc] initWithFrame: NSMakeRect(30,30,80,30)];
>> [label setSelectable: NO];
>> [label setBezeled: NO];
>> [label seDrawBackground: NO];
>> [label setStringValue : "Hello, This is a text field."];
>>
>> [[window contectView] addSubview: label];
>>
>> RELEASE(label);
>>
>> }
>>
>> -(void) applicationDidFinishLaunching:(NSNotification *)not
>> {
>> [window makeKeyAndOrderFront : self];
>> }
>>
>> -(void) dealloc
>> {
>> RELEASE(window);
>> [super dealloc];
>> }
>>
>> //
>> @end
>>
>>
>>
>> ------------------
>> //// main.m
>> #import <AppController.h>
>> #import <AppKit/NSApplication.h>
>>
>> int main(int argc, const char* argv[] )
>> {
>> NSAutoreleasePool *pool;
>> AppController *delegate;
>>
>> pool = [[NSAutoreleasePool alloc] init];
>> delegate = [[AppController alloc] init];
>>
>> [NSApplication sharedApplicatiion];
>> [NSApp setDelegate: delegate];
>>
>> RELEASE(pool);
>>
>> return NSApplicationMain(argc, argv);
>> }
>>
>> -----------------
>> //// GNUmakefile
>>
>> #GNUSTEP_MAKEFILES=/GNUStep/System/Library/Makefiles
>> include $(GNUSTEP_MAKEFILES)/common.make
>>
>> APP_NAME=firstwindow
>> firstwindow_HEADERS=AppController.h
>> firstwindow_OBJC_FILES=main.m AppController.m
>> firstwindow_RESOURCE_FILES=firstwindowInfo.plist
>>
>> include $(GNUSTEP_MAKEFILES)/application.make
>>
>>
>
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
>
--
View this message in context:
http://www.nabble.com/an-error-from-the-expression%3A-CLS_ISCLASS%28%28Class%29receiver%29--File%3A-sendmsg.c-Line-321-tp21990807p21992104.html
Sent from the GNUstep - General mailing list archive at Nabble.com.