diff --git a/addons/ofxiOS/src/core/ofxiOSEAGLView.mm b/addons/ofxiOS/src/core/ofxiOSEAGLView.mm index f1faae7b8e0..a093a4c9f97 100644 --- a/addons/ofxiOS/src/core/ofxiOSEAGLView.mm +++ b/addons/ofxiOS/src/core/ofxiOSEAGLView.mm @@ -99,7 +99,10 @@ - (void)setup { window = dynamic_pointer_cast(ofCreateWindow(windowSettings)); - ofRunApp(app); + // UIKit already owns the application loop when a custom app delegate + // installs this view. Register the app with the recreated window + // without starting the main loop again. + ofRunApp(window, std::static_pointer_cast(app)); } if(window->isProgrammableRenderer() == true) { diff --git a/addons/ofxiOS/src/core/ofxiOSGLKView.mm b/addons/ofxiOS/src/core/ofxiOSGLKView.mm index 04e83cde705..666d2211a4e 100644 --- a/addons/ofxiOS/src/core/ofxiOSGLKView.mm +++ b/addons/ofxiOS/src/core/ofxiOSGLKView.mm @@ -99,7 +99,10 @@ - (void)setup { window = dynamic_pointer_cast(ofCreateWindow(windowSettings)); - ofRunApp(app); + // UIKit already owns the application loop when a custom app delegate + // installs this view. Register the app with the recreated window + // without starting the main loop again. + ofRunApp(window, std::static_pointer_cast(app)); } if(window->isProgrammableRenderer() == true) {