I am have an app in which I draw shape. When I close and open the application the drawn shapes remains. I want to know is there any way I could clear the contents on each launch.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It sounds like you’re not actually terminating the app, but backgrounding it. When you launch the application again, it continues from where you left off: showing the drawn shape.
If you’d like to clear the shape when the application moves from the background into the foreground, you could implement
applicationWillEnterForeground:inUIApplicationDelegate(see here) or you could observeUIApplicationWillEnterForegroundNotifications (see here).