Launch GLBasic iPhone App from XCode UI Project

Previous topic - Next topic

fjsantosb

Hi,

I am trying to integrate a GLBasic iPhone App with a XCode UI App.
The objective is to 'launch' an iPhone GLBasic App from an UI XCode Project.

What I have done:

- I create a simple GLBasic Application and compile for iPhone (simple helloworld text on screen).
- I tested (standalone) on iPhone and works.

- I create a simple ui application (a button with text 'launch glbasic app').
- I copy all libraries from GLBasic project to UI project.
- I add other linker flags, etc to get 2 projects exactly the same.

- I add the following code to UI project when press button. (I have defined the two methods and tested that nil arguments works).

-(IBAction) launchGLBasic:(id) sender {
   isIphone();
   GLB_iPhone_call_main(nil, nil);
}

- Applications UI runs pretty well, but when i press the button, application hang up for a second and then crash.

Any clue, I have missed something?

Any help will be appreciated!

Thanks in advance.

King regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

trucidare

please add isIphone(); at program start. change all .m to .mm and try again.

write down the GDB log right here.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

fjsantosb

Hi Trucidare,

As usual thanks for helping :).

I tried your solution but is not working :(.

Log is:

Code (glbasic) Select

2010-08-16 17:05:38.395 Integration[1580:207] *** _NSAutoreleaseNoPool(): Object 0x1070f0 of class NSCFString autoreleased with no pool in place - just leaking
Stack: (0x31399f83 0x3136d973 0x3136d93f 0x33380344 0x1be18 0x6a1b 0x69d0)
2010-08-16 17:05:40.745 Integration[1580:207] *** Assertion failure in UIApplicationInstantiateSingleton(), /SourceCache/UIKit/UIKit-984.38/UIApplication.m:1014
2010-08-16 17:05:40.753 Integration[1580:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'There can only be one UIApplication instance.'
2010-08-16 17:05:40.765 Integration[1580:207] Stack: (
    827030813,
    875630100,
    826579763,
    825897577,
    857005364,
    857002196,
    121240,
    27995,
    826787983,
    857368452,
    857368300,
    857368244,
    857367308,
    857370508,
    857364736,
    857362324,
    857343888,
    857342100,
    844315076,
    826778923,
    826776607,
    844309416,
    857009200,
    857002544,
    27229,
    27088
)
terminate called after throwing an instance of 'NSException'
Program received signal:  "SIGABRT".
(gdb) continue
Program received signal:  "SIGABRT".
(gdb) continue
Program received signal:  "0".
(gdb)


Thanks in advance!

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

trucidare

ok there is the problem...

2 UIApplication methods. hmm have to speak to kittie to solve this.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

fjsantosb

Hi Trucidare,

Thanks so much, i will look forward for your solution :)

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

Kitty Hello

should I try to detect that and use the other instance instead?

fjsantosb

I really don't know what will be the best solution for this.

But your proposal makes sense to me.

With this method, I could regret to main app after 'end' command?

King Regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com

trucidare

hmm i think about a simple solution but not sure yet.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

fjsantosb

That sounds great!

If you need a project for testing (for convenience), don't hesitate to contact me!

Thanks for your help.

King regards, fjsantos.
Francisco Santos Belmonte founder of Tip Tap Games.
Website: www.tiptapgames.com
Twitter: www.twitter.com/tiptapgames
Facebook: http://dld.bz/dYVd
iPhone News & Sales: www.gamesappetizer.com