objective c - iOS 8 | Add image to UIActionSheet's button -
in ios 7 , below , added custom image on uiactionsheet
's buttons , seems doesn't work on ios 8 , crashes ! , here codes :
[[[sheet valueforkey:@"_buttons"] objectatindex:0] setimage:[uiimage imagenamed:@"image"] forstate:uicontrolstatenormal];
crashes due :
*** terminating app due uncaught exception 'nsunknownkeyexception', reason: '[<uiactionsheet 0x16d4abf0> valueforundefinedkey:]: class not key value coding-compliant key _buttons.' *** first throw phone call stack:
uiactionsheet
deprecated in ios8, may want utilize new uialertcontroller
uialertcontrollerstyleactionsheet
style.
i agree matt, should not utilize dirty ways custom uiactionsheet, safest , nicest way have uiactionsheet looks want create yours.
ios objective-c uiactionsheet
No comments:
Post a Comment