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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -