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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:14:23+00:00 2026-06-03T05:14:23+00:00

I am attempting to write an application in which I have two text fields

  • 0

I am attempting to write an application in which I have two text fields that I will be using for input. The input taken from the text fields are being initialized as a string. So what I want to accomplish is:

  • Create an SQLite database (file) that will be saved within the Xcode project (I’m not sure where it can be saved to, but I would need to be able to read it and write to it).
  • I then want to place the strings (from the text field inputs) into the SQLite table, which will only have two fields (for simplicity). I’m using a button to accept the input from the text fields, place the input into strings, and then put the value of the strings into a label(s).
  • I ultimately will want to place the strings from the text fields into the table, and then read the table to “grab” the strings and display them into the labels. All of this would be done by the click of a button.

I realize this is very specific, but I have been having a difficult time finding anything simple to accomplish this. I am very new to iOS development and I appreciate if anyone could be as specific and detailed as possible, or at least point me to some resources that would teach me how to accomplish this.

I am using Xcode v4.3.2 and I do not use Storyboard or ARC. I tried to be as detailed as possible, but as you can, my goal is really simple.

I’m tapped out and I appreciate all the help I can get.

Thanks!
-Matt

  • 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-03T05:14:25+00:00Added an answer on June 3, 2026 at 5:14 am
    • creating a database file: simply drop your data.sqlite file in your xcode project, as you drop any other class or image resource. Please note, that you will have to copy the file to writeable directory after app installation. take a look at createeditablecopyofdatabaseifneeded.
    • open your database with sqlite3_open with respect to your new database location.
    • query the database as you like with sqlite3_prepare_v2

    a simple query snippet looks like:

    NSString *querystring;
    
    // create your statement
    querystring= [NSString stringWithFormat:@"SELECT text1, text2 FROM datatable;"];  
    
    const char *sql = [querystring UTF8String];
    
    NSString *text1 = nil;
    NSString *text2 = nil;
    
    if (sqlite3_prepare_v2(db, sql, -1, &statement, NULL)!=SQLITE_OK){
    
        NSLog(@"sql problem occured with: %s", sql);
        NSLog(@"%s", sqlite3_errmsg(db));
    
    }
    else
    {
        // you could handle multiple rows here
        while (sqlite3_step(statement) == SQLITE_ROW) {            
    
           text1 = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 0)];
           text2 = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 1)];
    
        } // while        
    
    }
    sqlite3_finalize(statement);
    
    // go on with putting data where you want
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to write a VB.net application which will allow users to create
Morning Everyone, I've been attempting to write an application that does some GETs from
I am attempting to write an application that harvests information from a logged-in Facebook
I am attempting to write a cross-platform GUI application that would be deployed to
I am attempting to write a C# component which will expose events. The component
I am attempting to write a python daemon that will launch at boot. The
I am attempting to write a c# application that connects to TFS and retrieves
I'm attempting to write an integration test using the OCUnit/SenTest Framework which I feel
I'm attempting to write a Windows Phone 7 application which needs to connect to
I'm attempting to write a simple chat application in C using ncurses, both of

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.