0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UIPickerViewを使うときに気をつけること

Last updated at Posted at 2017-06-28
class ViewController: UIViewController,UIPickerViewDelegate, UIPickerViewDataSource {
  // ソースコード
}

ここからコードを書き進めると、Type ‘ViewController’ does not conform to protocol ‘UITableViewDataSource’ というエラーがで続けました。

func numberOfComponents(in pickerView: UIPickerView) -> Int {
        return 1
    }
    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
        return list.count

これを書くと、エラーがでなくなった!
どうやら、必須で書かないといけないコードらしい!

0
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?