I click the button and check if the (.png) or another data is exists in NSDocumentDirectory. if exists push the view controller or not.
I tried this,
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"u0-1b.png"];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:nil];
UIViewController *controller = (UIViewController *)[storyboard instantiateViewControllerWithIdentifier:@"SavedViewController"];
[self.navigationController pushViewController:controller animated:YES];
}
else
NSLog(@"file doesnt exist");
Here I given the full image name (u1-1b.png) it's woking but I want to check the data or extension (.png, or ).