troubleshooting Question

XCode Not Copying Database

Avatar of eDistrict
eDistrict asked on
DatabasesCiPhone
2 Comments1 Solution1058 ViewsLast Modified:
I've got an iPhone app that uses a SQLite database.  USED to work, until I built for distribution.  Now it's not working anymore.  It can FIND the database, and it can OPEN it, but can't READ from it.

STEPS:

1)  I added the database as an "existing file" to the resources directory of my project.
2)  I checked the checkbox "Copy this file's contents" in the popup when you add a file.
3)  I double-checked the original database before I copied it into the resource directory... 31M.
4)  I build the project.
5)  I checked the application directory for the build, and found that a file had been created that was the same name as my database file, but it was empty...  zero K in size.  No contents.
6)  When I ran the application, it found the database, and did an OPEN successfully... but when I tried to execute a "sqlite3_prepare_v2" statement, it returned a SQLITE_ERROR, which indicates that it can't read/find the database.

Any ideas?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros