Differences From Artifact [10883a3ba0]:
- File src/OFApplication.m — part of check-in [e40729d406] at 2013-02-12 18:22:15 on branch trunk — Prefix all ivars with an underscore. (user: js, size: 9008) [annotate] [blame] [check-ins using]
To Artifact [ca5bc2d367]:
- File
src/OFApplication.m
— part of check-in
[fb79b7f369]
at
2013-02-22 12:15:19
on branch trunk
— Print an error when OFApplication is subclassed.
It seems subclassing OFApplication instead of OFObject for the
application delegate is a common mistake. (user: js, size: 9367) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
72 73 74 75 76 77 78 | SIGNAL_HANDLER(SIGUSR2) #endif #undef SIGNAL_HANDLER int of_application_main(int *argc, char **argv[], Class cls) { | < | > > > > > > > > > > > > > < < < | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | SIGNAL_HANDLER(SIGUSR2) #endif #undef SIGNAL_HANDLER int of_application_main(int *argc, char **argv[], Class cls) { id <OFApplicationDelegate> delegate; #ifdef _WIN32 wchar_t **wargv, **wenvp; int wargc, si = 0; #endif if ([cls isSubclassOfClass: [OFApplication class]]) { fprintf(stderr, "FATAL ERROR:\n Class %s is a subclass of " "class OFApplication, but class\n %s was specified as " "application delegate!\n Most likely, you wanted to " "subclass OFObject instead or specified\n the wrong class " "with OF_APPLICATION_DELEGATE().\n", class_getName(cls), class_getName(cls)); exit(1); } app = [[OFApplication alloc] init]; [app OF_setArgumentCount: argc andArgumentValues: argv]; #ifdef _WIN32 __wgetmainargs(&wargc, &wargv, &wenvp, _CRT_glob, &si); [app OF_setArgumentCount: wargc andWideArgumentValues: wargv]; #endif delegate = [[cls alloc] init]; [app setDelegate: delegate]; [app run]; return 0; } @implementation OFApplication + (OFApplication*)sharedApplication { return app; } + (OFString*)programName { return [app programName]; } |
︙ | ︙ |