image - check if a UIbutton setImage is called in iOS -


is there simple way checking if setimage method of uibutton has been called? use storyboard place button (not should matter in case). (i.e. part of code) notified uibutton catimage's setimage has been called.

there many ways notify object when particular event occurs in ios.

  1. use delegate, when set image programatically call delegate method in other object notify event.

  2. send nsnotification, when image set send out nsnotification. other object should observe notification.

    [[nsnotificationcenter defaultcenter] postnotificationname:@"imageset" object:self userinfo:nil];

  3. use key value observing. if value of image changes, other object notification.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -