I use this to go to url from the view:
-(IBAction)linkButtonPressed:(id)sender {
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"url"]];
}
I have added launch images to the project named default.png and default@2x.png.
Now if a hyperlink is entered from a view (switching to safari), and the app later is re entered from running in backgroundm, then closed like this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:TRUE];
//The other cells here
else if(indexPath.row==4)
{
exit(0);
}
}
Now the launch image is chancged to a screenshot of the view where the link button was pressed. If I force close the app from home screen of the iphone (after link is entered), the launch image is black.
If I then enter the hyperlink from another view and exit from the tableview, the launch image is changed to new screenshot from this view etc..
What’s causing this and how to fix it?
Ps. Running the app on iPhone device with version 5.1.1
Using XCode 4
This is becuase when you go to Safari, the app is put in a background state. To prevent this, turn off background apps and fast app switching, following this.
How to disable fast application switching (multitasking) on iOS 4?