iphone - Access Boolean Value form Sqlite database -


i newly add column 1 of data base table using following query.

alter table 'user' add column 'ismarried' bool default 'false'; 

once database update done user 'jhon' has ismarried status 'true' in database.

and write sql query using objective c retrieve jhon's married status bellow.

bool married = [results boolforcolumn:@"ismarried"]; 

my problem boolean varible 'married' return false;

then add follwing line code check whether correctness

nsstring *strmarried = [results stringforcolumn:@"ispwdprotected"]; 

then strmarried return 'true' jhon. can 1 tell me how retrive boolean value using boolforcolumn method

bool isn't supported in sqlite, have stick integers (0 , 1) represent false , true respectively. more info on here: is there boolean literal in sqlite?

i'm not in front of mac can't test imagine following want want:

alter table 'user' add column 'ismarried' integer default 0; 

if update user 'jhon' have married status of 1, suspect call boolforcolumn return true.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -