1.一樣開個專案(View-based application)
開一個新專案 View-based application
2.開啓 xxxxxxxxxViewController.xib , 加入 Label , PickerView
3. 修改 xxxxxxxxxViewController.h : UIPickerView交給Delegate去做,加入implement the UIPickerViewDelegate, UIPickerViewDataSource classes. 與加入Outlet , Methold
4.修改xxxxxxxxxViewController.m :加入實作@synthesize mlabel , 與view進入點 "-(void)viewDidLoad" 加入初始值 , 與 複寫加入UIPickerView Delegate api .
5.xxxxxxxxxViewController.xib檔 , 連接file's owner => UIViewPickerView component on the view and create the following Outlets: dataSoucrce --> File's Owner ; delegate --> File's Owner , 設定值如下:
6.開啓 xxxxxxxxxAppDelegate.m 在 (void)applicationDidFinishLaunching:(UIApplication *)application function: 加入 Bundle
7.執行
沒有留言:
張貼留言
請留言~一起討論吧~