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 199489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:01:41+00:00 2026-05-11T17:01:41+00:00

– init { if(![super init]) return nil; //the database is stored in the application

  • 0
- init
{
    if(![super init]) return nil;

    //the database is stored in the application bundle.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSString *path = [documentsDirectory stringByAppendingFormat:@"/base.sqlite"];
    NSLog(@"%@",path);
    db = [FMDatabase databaseWithPath:path];
    [db setLogsErrors:YES];

    if (![db open]) { 
        NSLog(@"Could not open db."); 
        return 0; 
    } else { 
        NSLog(@"DB Open...."); 
    } 

    FMResultSet *rs = [db executeQuery:@"SELECT * FROM settings"]; 

    return self; 
}

that’s the code i use for trying to access the data from settings.
but this gives an error (and i can assure you that there is a settings table ! )

here is a dump from the terminal

BEGIN TRANSACTION;
CREATE TABLE About (id integer PRIMARY KEY AUTOINCREMENT,key varchar UNIQUE,value text);
DELETE FROM sqlite_sequence;
CREATE TABLE settings (version integer,updated timestamp,owner varchar);
INSERT INTO "settings" VALUES(1,'2009-05-11 14:29:07','boulevart');
COMMIT;

and the error:

2009-05-11 16:14:19.799 SummerGuide[9892:20b] /Users/andyjacobs/Library/Application Support/iPhone Simulator/User/Applications/762630F5-78CB-41A4-85C2-964316ACFE1D/Documents/base.sqlite
2009-05-11 16:14:19.801 SummerGuide[9892:20b] DB Open....
2009-05-11 16:14:19.804 SummerGuide[9892:20b] DB Error: 1 "no such table: settings"
2009-05-11 16:14:19.804 SummerGuide[9892:20b] DB Query: SELECT * FROM settings

the strange thing is if i change my path to for example /baseeeeee.sqlite (which ain’t no file ) it still says “DB Open….”

I just added an existing sqlite file (base.sqlite) to my recourse folder and added the sqlite3 lib to my frameworks.

  • 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-11T17:01:41+00:00Added an answer on May 11, 2026 at 5:01 pm

    To get the path to your file in the app bundle, use this:

    [[NSBundle mainBundle] pathForResource:@"base" ofType:@"sqlite"];
    

    To actually open the database, you may have to copy it to the Documents directory first, because trying to modify a file in your app bundle is bad news.

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

Sidebar

Ask A Question

Stats

  • Questions 131k
  • Answers 131k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is a bug of SubSonic 3.0.0.3, you should go… May 12, 2026 at 6:17 am
  • Editorial Team
    Editorial Team added an answer Well each method has its own purpose 1) init This… May 12, 2026 at 6:17 am
  • Editorial Team
    Editorial Team added an answer You mean the tooltip with the arguments to the function?… May 12, 2026 at 6:17 am

Related Questions

I am currently running into a problem where an element is coming back from
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
An extension to my previous question: Text cleaning and replacement: delete \n from a
I am generating some text to be shown on a web-site, and use HttpUtility.HtmlEncode
i have a text file with the following data: Calculated Concentrations 30.55 73.48 298.25

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.