Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer is a bit tricky but this always works for me. This is for a <strong>clean</strong> installation of a new compatible .sqlite file, <strong>not a migration</strong>!</p> <p>launch simulator, delete the app and the data (the popup after you delete the app).</p> <p>quit simulator</p> <p>open X-Code, after making any edits to your data model</p> <p>if needed update the datamodel version:</p> <ol> <li><code>Editor &gt; Add Model Version...</code></li> <li>set your prefs in the dialog that appears (counting up is preferable)</li> <li>click on the {appname}.xcdatamodeld then in the far right pane</li> <li>click the left icon of the 3 icons on top of the far right column</li> <li>under <code>Versioned Core Data Model</code> select the one you just created</li> </ol> <p>delete the <code>{appname}.sqlite</code> file (or back it up, remove it from project folder, and delete reference)</p> <p>clean the app (<code>Product &gt; Clean</code>)</p> <p>Run the app in a simulator (for this tutorial I will assume 4.2)</p> <p>While the simulator is running, in a Finder window, navigate to: <code>{home} &gt; Library &gt; Application Support &gt; iPhone Simulator &gt; 4.2 &gt; Applications &gt; {random identifier} &gt; Documents &gt; {appname}.sqlite</code></p> <p><strong>Copy</strong> this file to another location</p> <p>Stop running your app in X-Code</p> <p>Drag and drop the {appname}.sqlite file into the files list in X-Code.</p> <p>In the dialog that pops up, make sure the <code>copy to folder</code> checkbox, is checked.</p> <p><code>Product &gt; Clean</code></p> <p>Then run the app in the simulator again</p> <p>Now you should have a working sqlite file!</p> <p>Cheers, Robert</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.
    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