views:

32

answers:

1

I wrote a small application and tried running it on my device. I had written a function and tried calling it in application did finish launching. It didn't get called every time I ran my app from the homescreen. Then someone told me that applicationdidFinishLaunching doesn't get called every time you launch your app from the homescreen. I then tried calling it in viewDidLoad and later in viewWillAppear methods but it never got called after the first launch. So finally I had to put a UIButton and call the function on buttonClick after which it finally worked. Can someone tell me why it happened?

A: 

You probably are testing on iOS 4 which supports multitasking, where apps aren't exited but suspended. You should read a little about app lifecycle in iOS4

dusker