Просмотр исходного кода

Fix "unknown message" warning on OS X

- Forward declare the AppDelegate class, give the appDelegate
  pointer a specific type and move the handleEvent method
  into the .m file.
- The whole class definition could have been moved below
  the AppDelegate class definition and I wouldn't have had to
  bother with putting things in the .m file but this felt
  a little better (six of one, half-dozen of the other *shrug*).
Nur Monson 12 лет назад
Родитель
Сommit
f472d6e300

+ 5 - 9
IDE/Build/Mac OS X/PolycodeAppDelegate.h

@@ -14,21 +14,17 @@
 
 using namespace Polycode;
 
+@class PolycodeAppDelegate;
+
 class PolycodeAppEventHandler : public EventHandler {
 	
 public:
 	PolycodeAppEventHandler() {}
 	~PolycodeAppEventHandler() {}
 	
-	void handleEvent(Event *evt) {
-		switch(evt->getEventCode()) {
-			case PolycodeIDEApp::EVENT_SHOW_MENU:
-				[appDelegate showProjectMenu];
-			break;
-		}
-	}
-	
-	id appDelegate;
+	void handleEvent(Event *evt);
+
+	PolycodeAppDelegate* appDelegate;
 };
 
 @interface PolycodeAppDelegate : NSObject <NSApplicationDelegate> {

+ 8 - 0
IDE/Build/Mac OS X/PolycodeAppDelegate.m

@@ -8,6 +8,14 @@
 
 #import "PolycodeAppDelegate.h"
 
+void PolycodeAppEventHandler::handleEvent(Event *evt) {
+	switch(evt->getEventCode()) {
+		case PolycodeIDEApp::EVENT_SHOW_MENU:
+			[appDelegate showProjectMenu];
+			break;
+	}
+}
+
 @implementation PolycodeAppDelegate
 
 @synthesize window;