开发者

Check if a file exists in the documents directory

How can one check if开发者_JAVA技巧 a file exists in the documents directory by a specific name?


BOOL isMyFileThere = [[NSFileManager defaultManager] fileExistsAtPath:myFilePath];

Check in NSFileManager Documentation .


-[NSFileManager fileExistsAtPath:]


BOOL result = [[NSFileManager defaultManager] fileExistsAtPath:fileLocationofDocumentDirectory];

if(result ==YES)
{
NSLog(@"File present");
}
else
{
NSLog(@"File Not present");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜