From 3137b7ac5f98ac062c4a7df351f0836e52994b18 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 5 Oct 2014 10:06:46 +0200 Subject: examples/cocoa: never instance NSApplication with new Cocoa expects the you instance NSApplications only through the singleton method sharedApplication. --- DOCS/client_api_examples/cocoabasic.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'DOCS') diff --git a/DOCS/client_api_examples/cocoabasic.m b/DOCS/client_api_examples/cocoabasic.m index 6095a084d6..383d778f3e 100644 --- a/DOCS/client_api_examples/cocoabasic.m +++ b/DOCS/client_api_examples/cocoabasic.m @@ -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]; -- cgit v1.2.3