I am c# asp.net developer and just a newbe in developing ios apps. I am trying some tutorials to build some uipickerview. But the most tutorials are using an xib file. My project is a storyboard project and dont have a xib file. So Iam wondering how I can connect my datasource and delegate from my uipickerview? In some toturials I see the "view controller scene" window in xcode, but I cannot find it in my xcode. So can somebody tell me what to do to show this "view controller scene" OR how to connect my uipickerview to the datasource and delegate?
2 Answers
2
votes
The Storyboard is replacing the xib files and combines all your views into a single file for iPhone or iPad. To connect a picker view data source and delegate you can select the UIPickerView object in Interface Builder, go to the Connections Inspector (the menu with the arrow icon on the right) and there drag from the datasource to the view controller file owner. Do the same for the delegate.
Then in the header file of that view controller you need to add the UIPickerViewDataSource and UIPickerViewDelegate protocols to the interface and in the implementation file implement the relevant methods.