當我們單擊一個單元格時,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