我想显示保存在文档文件夹中的图像问题是它返回文件名但它没有在图像视图中显示图像
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString*patientlastName;
NSString*test=@"nicej";
patientlastName=[test stringByReplacingOccurrencesOfString:@" " withString:@""];
NSString * filePath = [NSString stringWithFormat:@"%@/Documents//%@.png", NSHomeDirectory(),patientlastName];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath];
if (fileExists == 0)
{
NSLog(@"File is Not exists");
appDelegate.imageURL=@"File Not Exists";
}
NSString *userfile=[NSString stringWithFormat:@"%@",patientlastName];
appDelegate.imageURL=userfile;
PictureDisplayViewController *targetController = [[PictureDisplayViewController alloc] initWithNibName:@"PictureDisplayViewController" bundle:nil];
targetController.modalPresentationStyle = UIModalPresentationFullScreen;
[self.splitViewController presentViewController:targetController animated:YES completion:nil];
在 PictureDisplayViewController 中
imageView.image=[UIImage imageNamed:@"nicej.png"];