I am doing this in applicationWillTerminate but alert does not show up only the log will be printed.
- (void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"Went to Background");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"app is terminated " delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
}