Ozvengrad
Ozvengrad

Reputation: 302

xcode 7 TableViewController

does anyone know how to add a UIPickerViewDataSource and a UIPickerViewDelegate to the class of TableViewController

class AddProductTableViewController: UITableViewController, UIPickerViewDataSource, UIPickerViewDelegate

because when I do it like that it keeps giving me an error of type 'AddProductTableViewController' does not conform to protocol 'UIPickerViewDataSource' it gives me the same error for the UIPickerViewDelegate

Upvotes: 0

Views: 103

Answers (1)

Luan Nguyen
Luan Nguyen

Reputation: 395

You need to implement all the required methods of UIPickerViewDataSource and UIPickerViewDelegate, if you want to conform to these protocols.

- numberOfComponentsInPickerView:

- pickerView:numberOfRowsInComponent:
...

Upvotes: 2

Related Questions