Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm happy! I was able to solve my own mess (!!?).</p> <p>I've discovered that, when I originally copied my 2 code snippets, specially the "read part", I didn't copy it literally as it appears on my actual code, I just adapted some variable names and extra stuff that wasn't important here. (Typical situation)</p> <p>I even did some more things than "removing some unrelated code pieces", (and here comes the important part), as I reordered some of them. And one of the parts I reordered was this one (which didn't work):</p> <pre><code>NSFileManager *localFileManager = [[NSFileManager alloc] init]; NSString *tmpPath=[NSString stringWithFormat:@"%@/.HistoricalTestResults", (NSString *)docsDir]; NSDirectoryEnumerator *dirEnum = [localFileManager enumeratorAtPath:tmpPath]; // create directory if it doesn't exist, don't do anything if it exists... (?) [localFileManager createDirectoryAtPath:tmpPath withIntermediateDirectories:YES attributes:nil error:nil]; </code></pre> <p>which I changed (when posting here), onto this other part (which works):</p> <pre><code>NSString *tmpPath=[NSString stringWithFormat:@"%@/.HistoricalTestResults", (NSString *)docsDir]; NSFileManager *localFileManager = [[NSFileManager alloc] init]; // create directory if it doesn't exist, don't do anything if it exists... (?) [localFileManager createDirectoryAtPath:tmpPath withIntermediateDirectories:YES attributes:nil error:nil]; NSDirectoryEnumerator *dirEnum = [localFileManager enumeratorAtPath:tmpPath]; </code></pre> <p>There's proably some logic behind this, as "why the first part <strong>does</strong> work on the emulator, but doesn't on the real device". It seems that "createDirectoryAtPath" is somewhat "resetting" some internal stuff, or maybe asking for an enumerator without having created a directory doesn't make sense...</p> <p>Whatever the case is, I think my experience is worth enough to keep it here posted for someone who might be in my situation in the future!</p> <p>Greetings again!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload