examples/cocoa: never instance NSApplication with new

Cocoa expects the you instance NSApplications only through the singleton
method sharedApplication.
This commit is contained in:
Stefano Pigozzi 2014-10-05 10:06:46 +02:00
parent 11609ab389
commit 3137b7ac5f
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ static void wakeup(void *context) {
// Delete this if you already have a main.m.
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSApplication *app = [NSApplication new];
NSApplication *app = [NSApplication sharedApplication];
AppDelegate *delegate = [AppDelegate new];
app.delegate = delegate;
[app run];