How to find a file in Project?
<p>I'm getting a problem to find a file from project. I am getting this file using code but I can't get it using url.</p>

<p>Please help me out from this problem.</p>

<p>Here is the path of file</p>

<blockquote>
  <p>Users/yatish/Library/Developer/CoreSimulator/Devices/65048208-DC46-4B30-9526-470D6D8081D3/data/Containers/Data/Application/2E7EFDA0-9C0C-4440-962D-610C2AC18DDD/Documents/file.txt</p>
</blockquote>

<p>Here is the code</p>

<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *Path = [NSString stringWithFormat:@"%@/%@%@",documentsDirectory,@"file"@".txt"];
[str writeToFile:Path atomically:YES encoding:NSUTF8StringEncoding error:&amp;error];

NSString *fn=@"file";
NSString *searchFilename =[fn stringByAppendingString:@".txt"]; // name of the PDF you are searching for
NSArray *pathss = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectorys = [pathss objectAtIndex:0];
NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:documentsDirectorys];
NSString *documentsSubpath;
BOOL fileFound = false;

while (documentsSubpath = [direnum nextObject])
{
    if (![documentsSubpath.lastPathComponent isEqual:searchFilename]) {
        continue;
        fileFound=NO;
    }

    NSLog(@"found %@", documentsSubpath);
    fileFound =YES;
}
if(fileFound){
   NSLog(@"File Found");///this line is execute when i run this code
}
</code></pre>