开发者

Check if a file exists in the documents directory

开发者 https://www.devze.com 2023-03-09 01:41 出处:网络
How can one check if开发者_JAVA技巧 a file exists in the documents directory by a specific name?BOOL isMyFileThere = [[NSFileManager defaultManager] fileExistsAtPath:myFilePath];

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

精彩评论

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

关注公众号