iphone - resourcePath not working Xcode -


I have created a SQLite database with data for my app, and dragged it into a supported file group in Xcode.

NSString * bundlePath = [[[NSBundle main bundle] resourcepath] stringbapping path comparison: @ "database ADB"];

This file does not read. However, if I enter the full file path:

NSString * bundlePath = @ "users / xxxx / apps / app / database.db";

The app works fine.


I have printed the file path by:

NSString * bundlePath = [[NSBundle mainBundle] resourcepath] stringByAppendingPathComponent: @ "database.db"];

And this is:

/ user / xxx / library / application support / iPhone simulator / 5.1 / application / EE614 EFA-BAF 9 -478E -xxxx-xxxx / app.app / database.db

Any ideas why?

The best way to deal with the path is to tell the API path string details about "applying" stuff Keep in mind

  NSString * path = [[NSBundle main bundle] pathForResource: @ "database" type: @ "db"];    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -