当我们单击一个单元格时,Iam有一个UItableview,我想要在单元格中获取数据,并且必须分配给另一个控制器中的UIlabel并显示它。就像我想为所有人在表格中的单元格使用didselectRowAtIndex将tableview单元格数据分配给文本字段
在那个控制器我有一个UIlabel我想更新单元格数据。
任何一个可以帮助我是新来这个
(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *[email protected]"cell";
UITableViewCell *cell=[tableview dequeueReusableCellWithIdentifier:cellidentifier];
if (cell==nil) {
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellidentifier];
}
cell.textLabel.text=[array objectAtIndex:indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Companydetails *details1= [[Companydetails alloc] initWithNibName:@"Companydetails" bundle:nil];
details1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:details1 animated:NO];
[details1 release];
UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath];
}
我已经在这个问题上主演了2分钟,但我无法掌握它的Xcode相关部分在哪里。任何人都帮助我? – 2013-02-02 06:32:29