我已经定义了 segmentControl 按钮。
@property(nonatomic, strong) SegmentControl *option;
SegmentControl *result = [[SegmentControl alloc] initWithFrame:frame items:@[@"Bad", @"Good"]];
result:self.option.selectedSegmentIndex
为什么我会收到此错误:在“segmentControl”类型的对象上找不到属性“selectedSegmentIndex”,
@class SegmentControl;
@protocol SegmentControlDelegate <NSObject>
@optional
- (void)segmentControl:(SegmentControl *)segmentControl didSelectSegment:(UIButton *)segment;
@end
@interface SegmentControl : UIView
@property(nonatomic, assign) BOOL staySelected;
@property(nonatomic, weak) id<SegmentControlDelegate> delegate;
- (id)initWithFrame:(CGRect)frame items:(NSArray *)items;
@end