0
我擁有數組的項目,而數組包含字符串值和id.I想從數組中獲取id。我選擇任何行,然後id應該通過下一個視圖類來更新下一個視圖的數據。 我嘗試,但我不知如何傳遞ID的所有數據到下一個視圖改變如何從數組中提取id並將其傳遞給下一個視圖,其值爲iphone
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[MyTableview deselectRowAtIndexPath:indexPath animated:YES];
if (self.editing) {
//Here
//modal is my class where i create all string variable and id variable to get database value
// here i want to pass id with next view please help here how to pass id at indexpath.row
modal* a=(modal*)[listitems objectAtIndex:indexPath.row];
if ([self.lstTasks objectAtIndex:indexPath.row]==(NSInteger) a.Id)
EditTask* content = [[EditTask alloc] initWithNibName:@"EditTask" bundle:nil];
content.navigationItem.title = @"Edit Task";
navController = [[UINavigationController alloc] initWithRootViewController: content];
_popover = [[UIPopoverController alloc]
initWithContentViewController:navController];
[content release];
[navController release];
_popover = [[UIPopoverController alloc]
initWithContentViewController:navController];
_popover.popoverContentSize = CGSizeMake(350, 450);
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[_popover presentPopoverFromRect:cell.bounds inView:cell.contentView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
//}
}
}
您好,我想通過酥料餅通過我的ID不pushviewcontroller u能幫助我在此 – Rocky
U可以做到pushVC只是一個例子.. – vishy
但如何通過我的taskid從didselectrowatindexpath。我得到一個taskid從列表數組我的代碼是寫或錯誤odal * a =(模態*)[ listitems objectAtIndex:indexPath.row]; ([self.lstTasks objectAtIndex:indexPath.row] ==(NSInteger)a.Id) – Rocky