Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In terms of your immediate problem, it's going to be something simple.</p> <ol> <li><p>You say you've "cleaned and built again", but have you actually removed the old app from your simulator? Either remove the app manually, or, easier, just reset the simulator entirely by choosing "reset content and settings" from the "iOS Simulator" menu. Sometimes Xcode is not good about knowing what files to copy over (particularly in a case like this where your running it on the device may be changing the timestamp of the file in the simulator's bundle!)</p></li> <li><p>Run the app again.</p></li> <li><p>If the app doesn't work as expected, open up the database in the simulator folder from the Mac and check out the database to make sure the table is there and precisely as you expected it to be. So navigate to the app, open the bundle (you may have to choose the "show package contents" option), confirm the existence of the database, but just as importantly, open it up this particular copy of the database in your favorite Mac <code>sqlite3</code> tool of choice and confirm the existence of the table there. </p></li> </ol> <p>Let us know what you find. Again, it's got to be something simple such as:</p> <ul> <li><p>Perhaps the process of rebuilding the app was not reinstalling everything; I've occasionally had problems where Xcode elected to not re-copy something during the install on my simulator;</p></li> <li><p>Perhaps your database in your project was accidentally put in a subdirectory, worse, you might have two copies sitting in different directories;</p></li> <li><p>Perhaps the database in your Xcode project is missing (or has a typo or (esp in the case of the device) has incorrect filename capitalization) in the name of the table or file;</p></li> <li><p>Etc.</p></li> </ul> <p>For a lot of these errors, you won't notice the problem until you completely reset the simulator itself. There are a million little things it could be, but hopefully completely resetting the simulator and starting over will help you find the issue. It's <em>always</em> something simple when it comes to these sorts of issues.</p> <hr> <p>Some other minor observations:</p> <ol> <li><p>You probably should not be opening databases from the bundle. Programmatically copy it from the bundle to the <code>Documents</code> folder, and open the database from there. I know it seems unnecessary, but it's important for a myriad of reasons (if db changes during operation of the app, if db accidentally gets created on you, don't let Xcode get confused about things that changed (even if only file timestamps) in the bundle changing behind Xcode's back, etc.)</p></li> <li><p>You should, if you need the database to be there, use <a href="http://www.sqlite.org/c3ref/open.html" rel="nofollow"><code>sqlite3_open_v2</code></a>, using either SQLITE_OPEN_READWRITE or SQLITE_OPEN_READONLY for flags (but do <em>not</em> include <code>SQLITE_OPEN_CREATE</code>). It causes headaches to ever give sqlite a chance to create a blank database for you, or otherwise modify it, so never give it an opportunity to so.</p></li> </ol>
    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. 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.
 

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