ios - How to check if a checkbox is checked or not -


i have 2 checkboxes , in controller want able know if checkboxes checked or not. code :

in .h :

@property (weak, nonatomic) iboutlet checkbox *option1button; @property (weak, nonatomic) iboutlet checkbox *option2button; 

in controller.m:

- (ibaction)optionbutton1pressed:(id)sender {    nslog(@"first : %lu second : %lu", (unsigned long)[_option1button state], (unsigned long)[_option2button state]); }  - (ibaction)optionbutton2pressed:(id)sender {    nslog(@"first : %lu second : %lu", (unsigned long)[_option1button state], (unsigned long)[_option2button state]); } 

the action mapped "touch inside". , can see in logs state 1 if check or uncheck checkboxes. everytime click, it's 1

i've tried "editing changed" it's never called

any idea?

i going assume checkbox derived uibutton... in case state...

so option1button.state & uicontrolstateselected want...

fyi:

enum {    uicontrolstatenormal               = 0,    uicontrolstatehighlighted          = 1 << 0,    uicontrolstatedisabled             = 1 << 1,    uicontrolstateselected             = 1 << 2,    uicontrolstateapplication          = 0x00ff0000,    uicontrolstatereserved             = 0xff000000  }; 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -