【发布时间】:2014-08-27 16:17:48
【问题描述】:
在 iOS 8 中,添加图像到 UIActionSheet's _button valueForKey. 的以下代码崩溃
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.'
我该如何解决?
【问题讨论】:
-
你有什么东西吗??
标签: ios ios8 uiactionsheet