开发者

Database Error : Compiling app on iphone device

开发者 https://www.devze.com 2023-01-02 07:24 出处:网络
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. B

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:

  1. Remove your app from the iPhone
  2. Clean all targets in Xcode
  3. Build and install again
0

精彩评论

暂无评论...
验证码 换一张
取 消