Aqlier/ 6月 11, 2019/ iPhone

Xcode 開発で、画像データを取り扱いたいとき、画像の格納先が必要になります。
Xcode で画像アプリを作成した際、画像の格納されているpathを判定する必要があったので以下に判定方法をまとめました。


  _databasePath = [[NSString alloc]
                     initWithString: [docsDir stringByAppendingPathComponent:
                                      @"xxxxx.DB"]];
    
    NSFileManager *filemgr = [NSFileManager defaultManager];
    
    if ([filemgr fileExistsAtPath: _databasePath ] == YES){
   //pathが一致した時

}else{
   //pathが違った時

}
0 0 投票
記事の評価

記事内容に関して、不明点・誤りがありましたらコメントをお願いします。

0 Comments
Inline Feedbacks
View all comments