iPhone “unable to open database file” for call_history.db in xcode app

前端 未结 2 1773
渐次进展
渐次进展 2020-12-03 13:19

I am trying to access database call_history.db in jailbroken iPhone. I am able to access call_history.db for iPhone 4 with iOS 4.1. But the problem is I am not able to acces

相关标签:
2条回答
  • 2020-12-03 13:35

    This was the best and easy tutorials i have seen
    http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/

    Instead of hard coding the path, try below.

    databaseName = @"AnimalDatabase.sql";
    
    // Get the path to the documents directory and append the databaseName
    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDir = [documentPaths objectAtIndex:0];
    databasePath = [documentsDir stringByAppendingPathComponent:databaseName];
    
    0 讨论(0)
  • 2020-12-03 13:36

    Your app is in a sandbox, which is not able to access anything outside of itself. Suppose your targeting jailbroken devices, this is another story.

    Xcode will install your app into a sandboxed environment. You need to manually sign the app using ldid -S /YourApp.app/YourApp then copy it tom the devices /Applications directory.

    0 讨论(0)
提交回复
热议问题