我有一个非常简单的子类UIViewController
:
@interface RoastChickenViewController : UIViewController {
IBOutlet UISlider *weightSlider;
}
@property (nonatomic,retain) UILabel *cookingTimeLabel;
- (void) weightValueHasChanged:(id)sender;
@end
我的 xib 文件设置为具有RoastChickenViewController
文件的所有者类型,并且weightSlider
已连接,并且“valueChanged”操作已连接到weightValuHasChanged:
.
问题是一旦我触摸滑块(模拟器或设备),我就会得到:
2010-08-21 20:26:07.688 CookIt1[26682:207] -[NSCFString weightValueHasChanged:]: unrecognized selector sent to instance 0x59215e0
2010-08-21 20:26:07.690 CookIt1[26682:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString weightValueHasChanged:]: unrecognized selector sent to instance 0x59215e0'
*** Call stack at first throw:
(
0 CoreFoundation 0x02395919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x024e35de objc_exception_throw + 47
2 CoreFoundation 0x0239742b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02307116 ___forwarding___ + 966
4 CoreFoundation 0x02306cd2 _CF_forwarding_prep_0 + 50
5 UIKit 0x002b9e14 -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x003436c8 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00345b4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x003c23ac -[UISlider beginTrackingWithTouch:withEvent:] + 731
一点点历史,我实际上是使用直接继承 UIView 来完成这项工作的。我已经设法在从 UIView 转换为 UIViewController 时打破它,我想这是实现这种简单行为的更自然的方式。
有没有我可以申请的清单,因为显然我缺少一些东西。