FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Quite strange question - how to exit sio manually?

2 posters

Go down

Quite strange question - how to exit sio manually? Empty Quite strange question - how to exit sio manually?

Post  _-MADMAN-_ Thu May 28, 2009 1:33 pm

I want to add exit button in my menu, here is callback function of widget tap:


Code:

void exit_callback(void*, void*, vec2*)
{
   sio2ResourceUnloadAll(sio2->_SIO2resource);
   sio2ResourceUnloadAll(level_demo);
   sio2ResourceUnloadAll(menu);
   
   sio2->_SIO2resource = sio2ResourceFree(sio2->_SIO2resource);
   level_demo = sio2ResourceFree(level_demo);
   menu = sio2ResourceFree(menu);
   sio2->_SIO2window = sio2WindowFree(sio2->_SIO2window);
   sio2 = sio2Shutdown();
   
   printf("\nSIO2: shutdown...\n");
}

Always hang device. Also tried sio2->_SIO2window->_SIO2windowrender = templateShutdown; but effect is the same - hanged device. How properly exit game without iPhone Home button?

Regards,
Mad

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

Back to top Go down

Quite strange question - how to exit sio manually? Empty Re: Quite strange question - how to exit sio manually?

Post  _-MADMAN-_ Fri May 29, 2009 6:24 am

Is it stiupid question or there is no answer? Wink If anyone knows how to manually shut down app I will really appreciate Your advice.

_-MADMAN-_

Posts : 52
Join date : 2009-04-23

Back to top Go down

Quite strange question - how to exit sio manually? Empty Re: Quite strange question - how to exit sio manually?

Post  andre.brito Tue Jun 02, 2009 5:04 am

First, let me say that, from what I've read, Apple policy forbids an app from exiting manually. According to Apple philosophy, an app should only exit when the user presses the home button.

Here's a way to do it, via an undocumented API function:
1. Add this to your .h
Code:
@interface UIApplication (extended)
-(void) terminateWithSuccess;
@end
2. Add this to where you want your app to terminate
Code:
[[UIApplication sharedApplication] terminateWithSuccess];

Just don't expect to have your app aproved for AppStore.

Best regards,
André
andre.brito
andre.brito

Posts : 13
Join date : 2009-01-05
Location : Lisbon, Portugal

http://www.evolve.pt/

Back to top Go down

Quite strange question - how to exit sio manually? Empty Re: Quite strange question - how to exit sio manually?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum