2016-01-24 67 views
-1

对于新的目标c,我需要以编程方式在uitableview单元格中显示Json响应。特定行的onclick在下一页的表格视图cell.please中显示其详细信息。编程的uitableview详细视图

+0

谷歌的教程,有很多 – Wain

+0

你可以去详细信息视图?或无法做到这一点 – Jamil

+0

其实我能够移动到详细视图页面,但无法显示相应的数据详细视图,我已经在uitableview中选择了单元格 – ananthi

回答

0

如果您正在使用故事板,则可以采用这种方式。

在您的DetailViewController.h文件中执行波纹管行。

@property(strong,nonatomic)id responseData;

然后实现波纹管的方法

-(void)tableView:(nonnull UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{ 

[tableView deselectRowAtIndexPath:indexPath animated:YES]; 

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
DetailViewController *eventDetailsViewController = [storyboard instantiateViewControllerWithIdentifier:@"DetailViewController"]; 
eventDetailsViewController.responseData = YourResponseData;//pass response data to detail view 
[self.navigationController pushViewController:eventDetailsViewController animated:YES]; 

}