Hallo,
ich versuche gerade mich in Obj-C einzuarbeiten und habe mir als Spielfeld eine Menübar App ausgesucht.
Der Code ist folgender:
Header
Source
Alles anzeigen
Das Problem ist nun folgendes: Sobald ich starte, läuft der Build-Prozess durch, aber das Programm crasht an dieser Stelle:
und zwar mit dieser Meldung:
Weiß einer woran das liegen könnte? Mir fällt zumindestens nichts offensichtliches im Moment auf, vielleicht könnt hier helfen
Gruß
PS: GC ist aktiviert
ich versuche gerade mich in Obj-C einzuarbeiten und habe mir als Spielfeld eine Menübar App ausgesucht.
Der Code ist folgender:
Header
Source
Quellcode
- #import "Controller.h"
- @implementation Controller
- - (id) init {
- [super init];
- playing = FALSE;
- bar = [NSStatusBar systemStatusBar];
- playPause = [bar statusItemWithLength:NSVariableStatusItemLength];
- [playPause setTitle:@"Play"];
- return self;
- }
- int main (int argsc, char **argv) {
- Controller *ctrl = [[Controller alloc] init];
- [ctrl release];
- }@end
Das Problem ist nun folgendes: Sobald ich starte, läuft der Build-Prozess durch, aber das Programm crasht an dieser Stelle:
und zwar mit dieser Meldung:
Quellcode
- Sun Jul 11 11:31:31 myPC XController[91446] : kCGErrorInvalidConnection: CGSSetWindowTags: Invalid connectionSun Jul 11 11:31:31 myPC XController[91446] : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.Sun Jul 11 11:31:31 myPC XController[91446] : kCGErrorInvalidConnection: CGSSetDeferOrdering: error setting or clearing window tags2010-07-11 11:31:31.032 XController[91446:a0f] _NXCreateWindow: error setting window property (1002)Sun Jul 11 11:31:31 myPC XController[91446] : kCGErrorInvalidConnection: CGSSetWindowEventMask: Invalid connection...Sun Jul 11 11:31:31 myPC XController[91446] : kCGErrorInvalidConnection: CGSGetActiveMenuBarDrawingStyle: Invalid connection2010-07-11 11:31:31.205 XController[91446:a0f] CGSGetActiveMenuBarDrawingStyle((CGSConnectionID)[NSApp contextID], &sCachedMenuBarDrawingStyle) returned error 1002 on line 41 in _NSStatusBarGetCachedMenuBarDrawingStyleSun Jul 11 11:31:31 myPC XController[91446] : kCGErrorInvalidConnection: CGSDisableUpdateForConnections: Invalid connection2010-07-11 11:31:31.377 XController[91446:a0f] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CGSDisableUpdate returned error 1002d'*** Call stack at first throw:( 0 CoreFoundation 0x00007fff86377cc4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00007fff83ab40f3 objc_exception_throw + 45 2 CoreFoundation 0x00007fff86377ae7 +[NSException raise:format:arguments:] + 103 3 CoreFoundation 0x00007fff86377a74 +[NSException raise:format:] + 148 4 AppKit 0x00007fff84b743b4 -[NSStatusItem _adjustLength] + 386 5 XController 0x0000000100000cdc -[Controller init] + 228 6 XController 0x0000000100000d91 main + 65 7 XController 0x0000000100000bf0 start + 52 8 ??? 0x0000000000000001 0x0 + 1)terminate called after throwing an instance of 'NSException'Program received signal: “SIGABRT”.
Weiß einer woran das liegen könnte? Mir fällt zumindestens nichts offensichtliches im Moment auf, vielleicht könnt hier helfen

Gruß
PS: GC ist aktiviert
