我想顯示保存在文件夾的問題圖像是返回文件名,但它不會在圖像查看如何在iPhone的顯示從文件夾圖像圖像ViewI
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString*patientlastName;
NSString*[email protected]"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");
[email protected]"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"];
在ImageView的,這也沒有顯示圖像 – user2240329
檢查我更新的答案 –
因爲你給了我現在的儲蓄文件,但它不會加載可能是什麼問題 – user2240329