Last active
July 3, 2021 01:17
Revisions
-
baobao revised this gist
Jul 3, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // ファイルパスの作成 NSString *filePath = [[dirPaths objectAtIndex:0] stringByAppendingPathComponent:@"img.png"]; // 【2. NSFileManagerを取得】 NSFileManager *fileManager = [NSFileManager defaultManager]; -
baobao revised this gist
Jul 3, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ // 【1. ファイルまでのパスを作成】 // ダウンロードした画像が格納されたディレクトリパス取得(適宜変更してください) NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); -
baobao created this gist
Jul 3, 2021 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // 【1. ファイルまでのパスを作成】 // ダウンロードした画像が格納されたディレクトリパス取得(適宜変更してください) NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // ファイルパスの作成 NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"img.png"]; // 【2. NSFileManagerを取得】 NSFileManager *fileManager = [NSFileManager defaultManager]; // 【3. NSFileManagerのfileExistsAtPathメソッドを実行】 // fileExistsAtPathメソッドでファイルの有無確認 BOOL isExist = [fileManager fileExistsAtPath:filePath]; // 1が出力されたら存在する NSLog(@"isExist: %d", isExist);