iPhone OS 4.0 issue with ApplicationDelegate


#1

Hi

I think the delegate method applicationWillResignActive is never called when you quit the application and back to Home.

So I have tried to implement the delegate method applicationWillTerminate but the same problem occured.

[code]@interface JuceAppStartupDelegate : NSObject
{
}

  • (void) applicationDidFinishLaunching: (UIApplication*) application;
  • (void) applicationWillResignActive: (UIApplication*) application;
  • (void) applicationWillTerminate:(UIApplication *)application;

@end

@implementation JuceAppStartupDelegate

  • (void) applicationDidFinishLaunching: (UIApplication*) application
    {
    String dummy;

    if (! juce_intialisingApp->initialiseApp (dummy))
    exit (0);
    }

  • (void) applicationWillResignActive: (UIApplication*) application
    {
    JUCEApplication::shutdownAppAndClearUp();
    }

  • (void) applicationWillTerminate: (UIApplication*) application
    {
    JUCEApplication::shutdownAppAndClearUp();
    }

@end
[/code]

Actually I do not know what is happening, typically UIApplicationDelegate is supposed to be compatible with iPhone framework.

It does not work on Simulator (ipad + iphone) and my iPod Touch device.

I also tried to put a breakpoint on JuceApplication::shutdown() and it is never called.

Thanks.


#2

Just a thought, - isn’t this to do with apps just moving to the background when you press home on iOS4?


#3

I thought I fixed this last week - are you talking about the tip?


#4

Sorry I did not download the last GIT release. I did, it works fine thanks.


#5

It was the best idea to implement it because we could notice that this might be a need for the application. And as we can see, it needs the OS 4.0 to issue this application. This is a good idea to make a resolution.