I am getting a problem when i compile my iphone database application to device. When i debug the code it says database path "out of scope" on the break point and it does not compile the statement. Below is the code i am using to access the database.
databaseName = @"Zen.sqlite";
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSStrin开发者_Go百科g *documentsDir = [documentPaths objectAtIndex:0];
databasePath = [documentsDir stringByAppendingPathComponent:databaseName];
It works perfectly fine when i use the same code on simulator. Please help me to get this work on iphone device as well. Thanks.
There are usually problems while testing sqlite on iPhone. The simple answer:
- Remove your app from the iPhone
- Clean all targets in Xcode
- Build and install again
精彩评论