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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:32:16+00:00 2026-06-01T07:32:16+00:00

I am working on a contacts database App. User can enter name, phone, email

  • 0

I am working on a contacts database App. User can enter name, phone, email in UITextFields and save data to a SQLite database. All works as expected but I like to show the user a confirmation when data was successfully saved. Implemented a status label showing “Saved” when record was saved to DB but I like the text to disappear after a second.

Hope you can help, I tried to implement the sleep() function right after self.statusLabel.text = @"Saved"; but it did not work. With code below
I get the status label to say “Saved” but this should disappear automatically after a second.

- (IBAction)saveButtonTapped:(id)sender
{
    sqlite3_stmt *statement;

    const char *dbpath = [databasePath UTF8String];

    if (sqlite3_open(dbpath, &timings) == SQLITE_OK) 
    {
        NSString *insertSQL = [NSString stringWithFormat:@"INSERT INTO TIMINGS (time) VALUES (\"%@\")", self.timeLabel.text];

        const char *insert_stmt = [insertSQL UTF8String];

        sqlite3_prepare_v2(timings, insert_stmt, -1, &statement, NULL);

        if (sqlite3_step(statement) == SQLITE_DONE) 
        {
            self.statusLabel.text = @"Saved";
            self.timeLabel.text = @"0:00:00";

        }
        else 
        {
            self.statusLabel.text = @"Failed";
        }
        sqlite3_finalize(statement);
        sqlite3_close(timings);
    }
}
  • 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-01T07:32:17+00:00Added an answer on June 1, 2026 at 7:32 am

    Try using

    [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
    

    Otherwise you may consider implement a NSTimer that fires after a second and clean the label.

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

Sidebar

Related Questions

I'm working profesionally on a php web application which contains contacts, among other data.
I am currently working on an app, where I need to insert contacts into
I'm working at a SaaS, where any tenant can have several lists of contacts,
I'm working on setting up a simple SQLite database to access via Python. So
OK, well I've been working on a simple app that allows users to save
My app I'm working on is a collection of notes organized by Contacts. I
I need to know how can I add data from the database without refreshing
I am working with the contacts API from android, where I insert and delete
I am currently working on an application named BlackBerry Contacts Sync and I am
I've been working on laying out the data structure for an application I'm working

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.