Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly stop an xCode project currently running?

This may sound like a silly question, however with the iOS 6 viewDidUnload no longer getting called, I'm interested in how to properly terminate an iOS app currently being debugged with xCode on the development device. Is hitting the stop button below enough?

enter image description here

What exactly happens when I hit that button? Is this the equivalent of sending a stop signal to the app, terminating the app immediately? Does any of the dealloc code gets called? The reason I'm asking is that after repeated debugging with start/stop I'm running into an issue where it appears as if my app is having random memory issues(No leaks are detected with profiling).

Your thoughts are appreciated!

like image 497
Alex Stone Avatar asked Apr 02 '13 16:04

Alex Stone


People also ask

How do I delete the build folder in IOS?

Clean the Build Folder To clean the build folder you can use the shortcut Command+Option+Shift+K or Menu Bar → Product → Hold Option Key → Clean build Folder .


2 Answers

Hitting stop kills the app instantly. No dealloc or other code gets called (notably none of your application delegate methods that may be saving data), the process is just terminated. All of the memory used by the process is then freed, and when you start again, you're starting from scratch.

This is unlikely to be the cause of "random memory" problems. If you can give more detail about the symptoms you're experiencing, there could be more to say.

The best way to simulate what a user might do is to hit the home button, then stop the process. This doesn't terminate your app, but you should be dealing with everything necessary when entering the background anyway.

like image 111
jrturton Avatar answered Sep 28 '22 00:09

jrturton


ApplicationWillTerminate is called once application is terminated properly. If you click on the stop button, your application is killed and you might not trace any method calls in that case. As there is no viewDidUnload or dealloc methods for UIViewController, however you can define your own dealloc method without calling the super dealloc.

You could have a look at the Application life Cycle. It might answer lot of questions.

like image 33
nsgulliver Avatar answered Sep 28 '22 00:09

nsgulliver