views:

53

answers:

1

Hey Guys .. I am new to programming in Objective C . I checked many tutorials on reading data in sqlite3 , but almost all of them have show the data in UITableView .

I have a page where the user types in the password, the password lets say 1234 is saved in the database ( I have created a table already ) . I have got the database into the project folder . I just want a statement like

if(databasepassword == correct from the uitextfield )
{
 show next page 
} 
else 
{ 
password is incorrect.text
}

I will figure out on how to show the next page and display the password is incorrect.text I just want a method to cross check with the password saved in the database . How can I do that ?

Regards

+1  A: 

Use the sqlite3 API's provided by Apple to read the password from the database. In detail:

  1. Add libsqlite3.dylib to your list of frameworks
  2. Start reading the SQLite3 documentation, especially the five-minute guide.

BTW, do you plan to let the user update this password? If you are just hard-coding a password and deploying it along with the app, then there's not much point in using a SQLite database to store it.

Marcelo Cantos
noob question : where can I read it ? Thanks
I will be doing that also later .. But as of now I just wanted the authentication page to work. I don't want to use NSUserDefaults
I added more detail to the answer. I'd appreciate it if you accepted it (tick the green tick). :-)
Marcelo Cantos
Thanks a bunch!
Marcelo Cantos
actually thanks to you