在iOS 8
,以下代碼墜毀添加圖片到UIActionSheet's
_button
valueForKey.
UIActionSheet _button valueforKey崩潰在iOS8上
UIActionSheet *action = [[UIActionSheet alloc ] initWithTitle:@"Choose Action!" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Start Auto Scroll", nil];
[[[action valueForKey:@"_buttons"] objectAtIndex:0] setImage:[UIImage imageNamed:@"autoScroll.png"] forState:UIControlStateNormal];
[action showInView:self.view];
崩潰日誌是
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIActionSheet 0x7ff6d8c61030> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _buttons.'
我該如何解決呢?
您得到的任何東西? – 2014-09-19 08:34:31