title: NSFileManager:enumeratorAtURL: returns a different form of URL to NSFileManager:URLForDirectory
body: <p>If I fetch my sandbox's Application Support directory using <code>NSFileManager:URLForDirectory</code> then I get back the following URL:</p>
  
  <pre><code>file://localhost/var/mobile/Applications/EA80DE91-394C-4EAB-B269-1081C859BB0F/Library/Application%20Support/
  </code></pre>
  
  <p>However if I use <code>NSFileManager:enumeratorAtURL</code> to search the directory I get back URLs of the form:</p>
  
  <pre><code>file://localhost/private/var/mobile/Applications/EA80DE91-394C-4EAB-B269-1081C859BB0F/Library/Application%20Support/
  </code></pre>
  
  <p>This is causing me problems because I'm doing URL search/replace manipulations and the difference causes a mismatch. I've run into this sort of difference elsewhere previously and my solution then was to use the path of the urls (using <code>NSURL:path</code>) instead of the raw URLs, however that won't work in this situation as the paths produced are:</p>
  
  <pre><code>/var/mobile/Applications/EA80DE91-394C-4EAB-B269-1081C859BB0F/Library/Application Support
  /private/var/mobile/Applications/EA80DE91-394C-4EAB-B269-1081C859BB0F/Library/Application Support/
  </code></pre>
  
  <p>What I am trying to do is this: I can have any number of files in my Application Support directory with the same name but different locations, and I need to extract the path  relative to the Application Support directory. i.e. if I have the following</p>
  
  <pre><code>/Application Support/abc/file.dat
  /ApplicationSupport/abc/def/file.dat
  </code></pre>
  
  <p>I want to be able to extract "abc" and "abc/def". I was doing this using the following code:</p>
  
  <pre><code>NSArray *keys = [NSArray arrayWithObject:NSURLIsRegularFileKey];
  NSDirectoryEnumerator *dirEnumerator = [self.fileManager enumeratorAtURL:[MyManager appSupportDirectory]
                                            includingPropertiesForKeys:keys
                                                               options:NSDirectoryEnumerationSkipsHiddenFiles
                                                          errorHandler:nil];
      for (NSURL *url in dirEnumerator)
      {
          if ( NSOrderedSame == [[url lastPathComponent] caseInsensitiveCompare:kFilename])
          {
              NSString *appSupportPath = [[MyManager appSupportDirectory] path];
              NSString *pathToFile = [url path];
              pathToFile = [pathToFile URLByDeletingLastPathComponent];
              NSString *subPath = [pathToFile  stringByReplacingOccurrencesOfString:appSupportPath withString:@""];
  </code></pre>
  
  <p>(MyManager:appSupportDirectory calls NSFileManager:URLForDirectory: using NSApplicationSupportDirectory)</p>
  
  <p>This works fine on the simulator where <code>enumeratorAtURL:</code> and <code>URLFOrDirectory:</code> return identical paths, but due to their differences on hardware it fails.</p>
  
  <p>Is there a way to get <code>enumeratorAtURL:</code> and <code>URLForDirectory:</code> to return identical paths, or if not is there an alternative elegant way of extracting the subpaths to what I am currently doing?</p>