Refetch the data


#1

Hello,
This book is fantastic!
I am in page 412.
I can fetch the xml data on my console. :slight_smile:
When I close my app and open it again, the xml data does not appear again on my console. It does when I restart the app.
Do you have an idea to refetch the the xml on the console by just opening the app?
It will be wonderful to know how to do it.
Thanks a lot.
Gil


#2

It will be very kind of you, Joe, if you could help me to solve the issue.
Thanks a lot,
Gil


#3

Yes, you can implement applicationWillEnterForeground: in your application delegate to tell the controller to reload its data.


#4

Thanks Joe,

I did something like that in my application delegate:

  • (void)applicationWillEnterForeground:(UIApplication )application
    {
    NSLog(@"!!! ENTER !!!");
    /

    Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    */
    }

Unfortunately, the message doe not appear on the console when I launch the application. :frowning:

Gil


#5

Right, when the app is launching, you get application:didFinishLaunchingWithOptions:. If it later goes to the background and comes back, you will get didEnterForeground (and only in that case).