gl/cocoa: Fix example on Mac OS X 10.10
authorThijs Vermeir <thijs.vermeir@barco.com>
Mon, 1 Dec 2014 09:59:32 +0000 (10:59 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:51 +0000 (19:31 +0000)
Using NSApp directly seems to confuse something, as the compiler
was expecting an id<NSFileManagerDelegate>. Switched to using
[NSApplication sharedApplication], and specified the delegate
protocol on the window class as well.

Similar to https://bugzilla.gnome.org/show_bug.cgi?id=738740

tests/examples/gl/cocoa/cocoa-videooverlay.m

index 9c5fc9a..78c1969 100755 (executable)
@@ -28,7 +28,7 @@
 /*                                                               */
 /* ============================================================= */
 
-@interface MainWindow: NSWindow {
+@interface MainWindow: NSWindow <NSApplicationDelegate> {
   GMainLoop *m_loop;
   GstElement *m_pipeline;
   gboolean m_isClosed;
@@ -52,7 +52,7 @@
     backing: NSBackingStoreBuffered defer: NO screen: nil];
 
   [self setReleasedWhenClosed:NO];
-  [NSApp setDelegate:self];
+  [[NSApplication sharedApplication] setDelegate:self];
 
   [self setTitle:@"gst-plugins-gl implements videooverlay interface"];