我有一个uipickerview,它带有一个ActionSheet。所有这些都在“MultiPicker”类中。我用这种方式从“FirstViewController”创建一个新实例:
multiPicker *multiPic = [[multiPicker alloc]init];
multiPic.delegate = self;
[multiPic action:aRunIndex];
在“multiPicker”中,在“action:”
中 UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:otroDelegate cancelButtonTitle:nil destructiveButtonTitle:@"Cancel" otherButtonTitles:@"Done", nil];
UIPickerView *pickerView = [[[UIPickerView alloc] init] autorelease];
pickerView.tag = 101;
pickerView.delegate = self;
pickerView.dataSource = self;
pickerView.showsSelectionIndicator = YES;
[actionSheet addSubview:pickerView];
[actionSheet showInView:self.view];
当MultiPicker完成时我需要“FirstViewController”,所以我可以在FirstView中更新表。我尝试将新委托设置为MultiPicker,因此它会在完成后告诉FirstView。但是第一段代码中的“multipic.delegate = self”指令导致应用程序崩溃并显示“由于未捕获的异常而终止”。
如果我只是将所有“MultiPicker”代码放在FirstViewController类中,而不是单独放入,当我尝试按下与“取消”不同的按钮时,操作表会被阻止
有什么想法吗?
谢谢你
答案 0 :(得分:0)