如何通过iOS应用程序中的UIPickerView实现视图之间的转换?

如何通过iOS应用程序中的UIPickerView实现视图之间的转换?,ios,objective-c,uiview,uipickerview,Ios,Objective C,Uiview,Uipickerview,我想实现一个自定义下拉菜单,允许用户在iOS应用程序中快速更改视图。为此,我决定使用UIPickerView。但是我没有找到任何关于如何通过UIPickerView更改视图的教程,因此我需要一些帮助和建议。代码示例将非常有用。下面的方法是用于行选择的UIPickerview委托方法 -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent: (NSInteger)component

我想实现一个自定义下拉菜单,允许用户在iOS应用程序中快速更改视图。为此,我决定使用
UIPickerView
。但是我没有找到任何关于如何通过
UIPickerView
更改视图的教程,因此我需要一些帮助和建议。代码示例将非常有用。

下面的方法是用于行选择的UIPickerview委托方法

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:
(NSInteger)component    
{
    //in this method hide the views that you don't want to show and show the views that you
    //don't want to hide, when a particular row is selected.

    NSLog(@"row selected----->>%d",row);
}

下面的方法是行选择的
UIPickerview
委托方法

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:
(NSInteger)component    
{
    //in this method hide the views that you don't want to show and show the views that you
    //don't want to hide, when a particular row is selected.

    NSLog(@"row selected----->>%d",row);
}

@rdelmar我尝试按照本教程使用UINavigationController。但它不起作用-我有一个异常。显示您尝试过的代码,以及您得到的异常。@rdelmar我尝试按照本教程使用UINavigationController。但是它不起作用-我有一个异常。显示您尝试的代码,以及您得到的异常。