I created a sqlite database containing data for my application and dragged it into a group of supporting files in Xcode.
When I try to access it using:
NSString *bundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"database.db"];
It does not read the file. However, if I attach the full path to the file:
NSString *bundlePath = @"Users/xxxx/Apps/App/database.db";
The app works great.
I printed the file path:
NSString *bundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"database.db"];
and this:
/Users/xxx/Library/Application Support/iPhone Simulator/5.1/Applications/EE614EFA-BAF9-478E-xxxx-xxxx/App.app/database.db
Any ideas why?
source share