In view controller:
(1) conform protocol: UIPickerViewDelegate, UIPickerViewDataSource
(2) add an outlet for UIPickerView
(3) implement two picker data source method
numberOfComponentInPickerView &
pickerView: numberOfRowsInComponent
In IB:
(1) add picker view to view
(2) connect file's owner's outlet pickerView to pickerView
(3) connect pickerView's outlet dataSource & delegate to file's owner
沒有留言:
張貼留言