简体   繁体   中英

IOS: save an uimage when I press home button

In my app I should color some images but I have a problem

I have three viewcontroller, and I save my image in NShomedirectory/documents

When I color I'm in thirdViewController, when I change image with an IBAction I save it in NSHomedirectory, but if I'm coloring an image and I press home button , my image is not saved when I open a second time my app; (my app is not multitasking for some reason) is there a way to intercep home button press?

Following method is called when your app goes to background.

- (void)applicationDidEnterBackground:(UIApplication *)application

you can have image saving code in this method.

Check this link for more details - UIApplicationDelegate

yes

In your AppDelegate you can overload this:

- (void)applicationWillResignActive:(UIApplication *)application;

your application enter in this function each time you click on the home button

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM