Iphone 带有UIPickerView的无法解释的警告
我在我的应用程序中实现了一个简单的UIPickerView,我不断收到一些无法解释的警告,如未完成的实现和“协议中的方法未完成”。我看了一大堆例子,不知道我遗漏了什么 这是我的密码: hIphone 带有UIPickerView的无法解释的警告,iphone,objective-c,xcode,uiviewcontroller,uipickerview,Iphone,Objective C,Xcode,Uiviewcontroller,Uipickerview,我在我的应用程序中实现了一个简单的UIPickerView,我不断收到一些无法解释的警告,如未完成的实现和“协议中的方法未完成”。我看了一大堆例子,不知道我遗漏了什么 这是我的密码: h 在.h文件中,您声明自己符合以下协议: <UITableViewDelegate, UITableViewDataSource, UIPageViewControllerDataSource, UIPageViewControllerDataSource> 这些协议中的每一个都涉及一些您必须实
在
.h
文件中,您声明自己符合以下协议:
<UITableViewDelegate, UITableViewDataSource, UIPageViewControllerDataSource, UIPageViewControllerDataSource>
这些协议中的每一个都涉及一些您必须实现的方法(有关详细信息,请参阅每个协议的文档)。如果您没有实现所有必需的方法,您将收到此警告。在您的
.h
文件中,您声明自己符合以下协议:
<UITableViewDelegate, UITableViewDataSource, UIPageViewControllerDataSource, UIPageViewControllerDataSource>
这些协议中的每一个都涉及一些您必须实现的方法(有关详细信息,请参阅每个协议的文档)。如果您没有实现所有必需的方法,您将收到此警告。您需要遵守.h中的
UIPickerViewDelegate
和UIPickerViewDataSource
,就像您对UITableViewDelegate、UITableViewDataSource等所做的那样(您目前没有)
您需要遵守.h中的
UIPickerViewDelegate
和UIPickerViewDataSource
,就像您对UITableViewDelegate、UITableViewDataSource等所做的那样(您目前没有)
没什么区别…是一样的。当我添加您添加的最后两行时,我得到以下警告:“将'ViewTestController'*const_strong传递给不兼容类型'idOk my bad-的参数,我添加了UIPageView而不是UIPickerView…:/!在使用自动完成时,请始终仔细检查。没有区别…相同的事情。当我添加您添加的最后两行时,我得到以下警告:“将'ViewTestController'*const_strong传递给不兼容类型'idOk my bad-的参数,我添加了UIPageView而不是UIPickerView…:/!在使用自动完成时,请始终仔细检查。确定我的错误-我添加了UIPageView而不是UIPickerView…:/确定我的错误-我添加了UIPageView而不是UIPickerView…:/
<UITableViewDelegate, UITableViewDataSource, UIPageViewControllerDataSource, UIPageViewControllerDataSource>
@interface ViewTestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate, UITableViewDelegate, UITableViewDataSource, UIPageViewControllerDataSource, UIPageViewControllerDataSource> {
//PICKER AREA
pickerList = [[NSMutableArray alloc] init];
[pickerList addObject:@"aaa"];
[pickerList addObject:@"bbb"];
CGRect pickerFrame = CGRectMake(0, 200, 0, 0);
pickerView = [[UIPickerView alloc] initWithFrame:pickerFrame];
pickerView.showsSelectionIndicator = YES;
pickerView.dataSource = self;
pickerView.delegate = self;