Sowmya Sowmya - 10 days ago 4x
Objective-C Question

objective c,checking file exist at path

I have created a screen using Objective-C in an iPhone project. In that, there are 2 buttons (say A and B). On the click of button A, one xml file will be created in a folder (say INBOX).

My problem is, I need to create the file only if it does not exist at folder INBOX.
How can I do this? Can any one tell me the syntax?


Can you Please Check NSFileManager.

NSFileManager *fileManager = [NSFileManager defaultManager];

NSString *pathForFile;

if ([fileManager fileExistsAtPath:pathForFile]){