1

I am creating a class for creating window for multiple platforms including Windows, Mac, Linux, iOS and Android. I want my class to work the following way

    MyWindow window( "My Window", 480, 320 );
    while( window.IsRunning() )
    {
        // do something
    }

However, on iOS, we are needed to call UIApplicationMain after main is called which takes care of all the internal stuff and the main loop. I was wondering if there was any way to bypass UIApplicationMain so that I could get control of the main loop on iOS? A working code example would be of great help.

Thank you.

HDdeveloper
  • 4,396
  • 6
  • 40
  • 65
  • 2
    You can't, really. It needs to be called. If you need this, you probably have a design problem. –  Feb 13 '13 at 12:30

1 Answers1

0

As @H2CO3 told, You cant.

There are many limitations , Eg: iOS mobile app can have only one window, but the Mac OS can have multiple window, how will you handle that?

Also see this and App Life Cycle and Apple Docs

But you can follow some time saving tricks.

You can design your code in parts

  1. Code that handle data

  2. Code that handle the UI update

    Design your UI according to the native app SDK, then update UI according to the call backs.

    You can use different tools for converting you code like Google's Java To Obj C and ObjC to java

Only some part of code can be reused, but most of the part you have rewrite for different platforms.

You can also try to use some cross platforms.

Community
  • 1
  • 1
HDdeveloper
  • 4,396
  • 6
  • 40
  • 65