title: How to insert the data into sqlite database after entering in background in with objective-c
body: <p>Code which am using are as follows</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application
  {
      [self performSelector:@selector(addContacts) withObject:nil afterDelay:0.1];
  }
  
  -(void)addContacts
  {
      sqlite3_stmt    *statement;
  
      const char *dbpath = [databasePath UTF8String];
  
      if (sqlite3_open(dbpath, &amp;contactDB) == SQLITE_OK)
      {
          NSString *insertSQL = [NSString stringWithFormat:
                                 @"INSERT INTO CONTACTS (name, address, phone) VALUES (\"%@\", \"%@\", \"%@\")",
                                 @"Anu", @"0009", @"Hyderabad"];
  
          const char *insert_stmt = [insertSQL UTF8String];
          sqlite3_prepare_v2(contactDB, insert_stmt,
                             -1, &amp;statement, NULL);
          if (sqlite3_step(statement) == SQLITE_DONE)
          {
  
  
          }
          else {
  
              }
          sqlite3_finalize(statement);
          sqlite3_close(contactDB);
      }
  
  else
  {
      UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Information Alert"
                                                        message:@"Please enter the name "
                                                       delegate:nil
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:nil];
      [message show];
  }
  }
  </code></pre>
  
  <p>But its not working when its in the background</p>