【发布时间】:2015-04-06 18:46:21
【问题描述】:
我有一个按钮、一个pickerview 和一个tableview。当我按下按钮时,当前选择的pickerview 将被填充到表格视图中。这是从pickerview中选择值的按钮代码
- (IBAction)addCourse:(UIButton *)sender {
NSInteger numRow=[picker selectedRowInComponent:kNumComponent];//0=1st,1=2nd,etc
NSInteger SeaRow=[picker selectedRowInComponent:kSeaComponent];//0=fall,1=spring,2=summer
NSInteger CourseRow=[picker selectedRowInComponent:kCourseComponent];
NSString *num=Number[numRow];
NSString *season=Season[SeaRow];
NSString *course=Course[CourseRow];
NSString *msgCourse=[[NSString alloc ]initWithFormat:@"%@ ",course];
NSString *msgSeason=[[NSString alloc ]initWithFormat:@"%@ ",season];
NSString *msgYear=[[NSString alloc ]initWithFormat:@"%@ ",num];
}
然后我想将 msgCourse 等填充到我的 tableview 中
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
...Content from above msgCourse and etc
return cell;
}
请问如何解决我第二部分的空白?或者有什么可以看的例子吗?
【问题讨论】:
标签: ios uitableview ios7 uipickerview