我的视图上有许多不同的控制器,我有一些通过代码创建的pickerview,例如:
UIPickerView *picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 243, 320, 216)];
switch (sender.tag){
case 0:
picker.tag = 0;
break;
case 1:
picker.tag = 1;
break;
case 2:
picker.tag = 2;
break;
case 3:
picker.tag = 3;
break;
}
picker.delegate=self;
picker.dataSource = self;
picker.showsSelectionIndicator = YES;
[self.view addSubview:picker];
现在我需要使用它的默认设置(viewdidload
)。如何使用标签来做到这一点?