iphone - Proper way to convert BOOL value into INT? -


everytime when tried convert bool value int. int value showing -8 true , 0 false. ideally should return 1 true.

i have tried possible ways of conversion like

int val=info.isattachementdownloadable; int val=[[nsstring stringwithformat:@"%d", info.isattachementdownloadable] intvalue]; int val=(int)info.isattachementdownloadable; 

where info.isattachementdownloadable return bool

in ways showing -8 true.

any suggestion ?

maybe help(thought don't know why may needed in first place)

nsinteger = @(yes).integervalue; 

hope helps you.


Comments

Popular posts from this blog

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

java - Why is BlockingQueue.take() not releasing the thread? -

jQuery Ajax Render Fragments OR Whole Page -