首先,我想说我才刚刚开始“学习”objective-c。对不起,如果我犯了大错
我试图-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component
从视图 2 委托给视图 1 ...
查看 1.h:
@interface ViewController : UIViewController <PopOverViewControllerDelegate>
查看 1 米:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{ //stuff here}
查看 2.h:
@protocol PopOverViewControllerDelegate <NSObject, UIPickerViewDelegate>
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component;
@end
@interface PopOverViewController : UIViewController <UIPickerViewDataSource>
查看 2 米:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{
[self.delegate pickerView:categoryPicker didSelectRow:row inComponent:component];
}
这没用...