UIPickerView programmatic example?

后端 未结 4 1023
旧时难觅i
旧时难觅i 2020-12-02 19:45

How do I programmatically setup up the UIPickerView in a view without using Interface Builder? Also having trouble understanding how to work with the delegate portions of t

4条回答
  •  长情又很酷
    2020-12-02 20:35

     NSInteger selectCourse=[_coursePicker selectedRowInComponent:0];
        NSInteger selectSem=[_coursePicker selectedRowInComponent:1];
        NSString *whatCourse=[Course objectAtIndex:selectCourse];
        NSString *whatSem=[Sem objectAtIndex:selectSem];
    
        NSString *courses=[[NSString alloc]initWithFormat:@"Course : %@ - %@",whatCourse,whatSem];
    
        [self.selectedCours setTitle:courses forState:UIControlStateNormal];
    

提交回复
热议问题