Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some SDK Version ago (I don't know for sure when they did) apple changed the return type of <code>applicationDocumentsDirectory</code> in their project templates.</p> <p>When you create a new project it looks like this:</p> <pre><code>/** Returns the URL to the application's Documents directory. */ - (NSURL *)applicationDocumentsDirectory { return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } </code></pre> <p>in older templates it looked like this:</p> <pre><code>/** Returns the path to the application's documents directory. */ - (NSString *)applicationDocumentsDirectory { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *basePath = ([paths count] &gt; 0) ? [paths objectAtIndex:0] : nil; return basePath; } </code></pre> <p>and in between those two it looked like this:</p> <pre><code>/** Returns the path to the application's Documents directory. */ - (NSString *)applicationDocumentsDirectory { return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; } </code></pre> <p>So you have to be careful, because all the old code that relies on applicationDocumentsDirectory returning a NSString won't work with newer templates.</p> <p>And you can't just replace the new version with the older version because this would result in a change in your core data methods. </p> <p>So I would suggest you to write your own method for returning the documents directory. Apple changes their <code>applicationDocumentsDirectory</code> quite often. </p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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