在iOS 7和更低版本中,我在UIActionSheet
的按鈕上添加了自定義圖像,但它似乎不適用於iOS 8並且崩潰! ,這裏是代碼:iOS 8 |將圖像添加到UIActionSheet的按鈕
[[[sheet valueForKey:@"_buttons"] objectAtIndex:0] setImage:[UIImage imageNamed:@"image"] forState:UIControlStateNormal];
崩潰是由於:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIActionSheet 0x16d4abf0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _buttons.'
*** First throw call stack: