Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
-(void)viewDidLoadピッカーを特定の値で起動させる方法はありますか。たとえば、 1 、 2 、 3 、 4 、 5 を示すピッカーがあった場合、 3 で起動できますか。それは理にかなっていますか? ありがとう
-(void)viewDidLoad
このインスタンス メソッドを使用できます。
- (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated;
UIPickerView ドキュメント
あなたの場合、次のようになります。
- (void)viewDidLoad { [super viewDidLoad]; [myPickerView selectRow:3 inComponent:0 animated:NO]; }