Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6946123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:31:28+00:00 2026-05-27T13:31:28+00:00

I made a application for Ipad and it was working fine on simultor but

  • 0

I made a application for Ipad and it was working fine on simultor but when it installed on device for testing, database is not loading the value.

I am developing for the ios 4.3 target and I add the sqlite database file into supporting file folder and in Appdelegate file in add this code:

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary  *)launchOptions
{
    [self createDatabaseExecutableFile];
}

and the method code is

// Creates a writable copy of the bundled default database in the application Documents directory.
- (void) createDatabaseExecutableFile 
{
    // First, test for existence.
    BOOL _success;
    NSFileManager* _fileManager = [NSFileManager defaultManager];
    NSError* _error;
    NSArray* _paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* _documentsDirectory = [_paths objectAtIndex:0];
    NSString* _writableDBPath = [_documentsDirectory stringByAppendingPathComponent:@"turfnutritiontool_ver_two.db"];
    _success = [_fileManager fileExistsAtPath:_writableDBPath];
    if (_success)
        return;
    // The writable database does not exist, so copy the default to the appropriate location.
    NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"turfnutritiontool_ver_two.db"];
    _success = [_fileManager copyItemAtPath:defaultDBPath toPath:_writableDBPath error:&_error];
    if (!_success) {
        NSAssert1(0, @"Failed to create writable database file with message '%@'.", [_error localizedDescription]);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:31:28+00:00Added an answer on May 27, 2026 at 1:31 pm

    Well let me ask did you jail break your ios device …

    any ways debug line by line and check whether

    your _writableDBPath value and check whether db is on that location.

    hope this will help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an application and I have installed it on my iphone, but
I made iPad application in which, I want to insert record into database table,
I made an application and it seems its working fine when I build the
i created an iPad application, in which navigation is not working, for example on
I'm working on a universal iPhone/iPad application. I'm using MonoTouch, but I can take
I have made an application using Java/Hibernate/MySQL, but whenever I try running it, it
i have a windows application made in VB.NET which maintains a database, and i
I have made my application universal for iPhone and iPad (window-based application; universal) from
i have made iPhone Application and i want to make it iPad Compatible without
I'm developing an iPad application. I have been provided with a PNG image that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.