0
我在名稱爲1.png的文檔目錄中有圖像。我想在imageview中顯示該圖像。 我用下面的代碼,但圖像不顯示在圖像視圖。圖像不是從文檔目錄中檢索
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSLog(@"%@",paths);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:@"1.png"];
UIImage *img = [UIImage imageWithContentsOfFile:getImagePath];
NSLog(@"%@",getImagePath);
imge.image=img;