I am new to iPhone. i have faced a new problem. I have an api interaction in my app. That api take long time for loading. when i terminate my app manually,while loading that api
I suppose you mean a web API call, like google's geoservices. To do this, you will need to make the call using a NSURLConnection. This way, you can cancel a call anytime using [connection cancel].
Try this tutorial: http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/ It's meant for a JSON api call. If you need another API, just start reading from 'fetching JSON over HTTP', there they set up a NSURLConnection. If you retain this connection until it's done, you will be able to make the [connection cancel] call at anytime.
Using the UIApplicationDelegate, you can detect the app entering the background.