The iPhone SDK only provides the following APIs to exit the application:
[CPP]
View plaincopy
- Exit (0 );
However, if this method does not have the animation effect, you can exit the program directly, giving the user the feeling that the program has exited due to an exception.
There is also a way to exit the program on the Internet, that is, to use undisclosed APIs. This method is more unreliable, because the use of undisclosed APIs cannot be declared through the appstore, in addition, the test in MySQL 4.0 is invalid.
You can only use exit (0) to exit the application. Considering that this method only lacks the animation effect when exiting, you can add an animation and call exit to exit the program after the animation is completed.
[CPP]
View plaincopy
- -(Void) exitapplication {
- [Uiview beginanimations: @ "exitapplication" context: Nil];
- [Uiview setanimationduration: 0.5];
- [Uiview setanimationdelegate: Self];
- [Uiview setanimationtransition: uiviewanimationcurveeaseout forview: Self. Window cache: No];
- [Uiview setanimationdidstopselector: @ selector (animationfinished: Finished: context :)];
- Self. Window. bounds = cgrectmake (0, 0, 0, 0 );
- [Uiview commitanimations];
- }
- -(Void) animationfinished :( nsstring *) animationid finished :( nsnumber *) finished context :( void *) Context {
- If ([animationid compare: @ "exitapplication"] = 0 ){
- Exit (0 );
- }
- }
The iPhone SDK only provides the following APIs to exit the application:
[CPP]
View plaincopy
- Exit (0 );
However, if this method does not have the animation effect, you can exit the program directly, giving the user the feeling that the program has exited due to an exception.
There is also a way to exit the program on the Internet, that is, to use undisclosed APIs. This method is more unreliable, because the use of undisclosed APIs cannot be declared through the appstore, in addition, the test in MySQL 4.0 is invalid.
You can only use exit (0) to exit the application. Considering that this method only lacks the animation effect when exiting, you can add an animation and call exit to exit the program after the animation is completed.
[CPP]
View plaincopy
- -(Void) exitapplication {
- [Uiview beginanimations: @ "exitapplication" context: Nil];
- [Uiview setanimationduration: 0.5];
- [Uiview setanimationdelegate: Self];
- [Uiview setanimationtransition: uiviewanimationcurveeaseout forview: Self. Window cache: No];
- [Uiview setanimationdidstopselector: @ selector (animationfinished: Finished: context :)];
- Self. Window. bounds = cgrectmake (0, 0, 0, 0 );
- [Uiview commitanimations];
- }
- -(Void) animationfinished :( nsstring *) animationid finished :( nsnumber *) finished context :( void *) Context {
- If ([animationid compare: @ "exitapplication"] = 0 ){
- Exit (0 );
- }
- }