Author Topic: Launch GLBasic iPhone App from XCode UI Project  (Read 2724 times)

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
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

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
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

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
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

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
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

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10675
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
should I try to detect that and use the other instance instead?

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
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

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
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

Offline fjsantosb

  • Dr. Type
  • ****
  • Posts: 258
    • View Profile
    • Tip Tap Games - iPhone, iPad and iPod Touch Games
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