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

  • Home
  • SEARCH
  • 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 8651325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:02:21+00:00 2026-06-12T14:02:21+00:00

OK so at the initial loading of my app, I read from a sqlite

  • 0

OK so at the initial loading of my app, I read from a sqlite database. I use this code to open it:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"golfScores.sqlite"];

if(sqlite3_open([path UTF8String], &database) == SQLITE_OK){

I’ve been lead to believe that this opens the database from the app directory, not the app bundle. Everything works fine within the app when adding, deleting, or updating records. I can close the app and reopen it and the data appears as it should. The problem is that if I go and look at the database with the Terminal, nothing has changed. It’s completely different. So it must be using and saving to a database within the bundle, right? How can I get the app to update the database in the app directory?

  • 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-06-12T14:02:22+00:00Added an answer on June 12, 2026 at 2:02 pm

    Your code looks correct to me and it sounds as if it is working just fine! You are definitely not accessing your application bundle. Files in the bundle are not meant to be edited by your application because it breaks the code signing. They can be read, however, using the NSBundle class.

    I would guess that whatever you’re looking at with Terminal is not the same database file that your application is accessing.

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

Sidebar

Related Questions

I have a rails app with a heavy initial data in the database. Everytime
I'm using the code below to present the initial View Controller from a Bundle.
I've read in so many places that code-splitting can significantly speed up the initial
How can I change the initial image when app is loading. Currently it is
Initial Question Yesterday i read about ECMAScript 5 Object.create() And I wanted to start
In my iPhone app, I have a UIWebView where I'm loading a local html.
I am learning to develop mobile applications, quite in the initial phase. This query
I've installed South on my existing Django app. This Django app is on Heroku
I am getting this error when running ./manage.py migrate app_name While loading migration 'whatever.0001_initial':
I'm building an app that begins by loading a 'downloading' view controller which fetches

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.