-1
I have a list of items inside a Tableview I would like when clicking on a list item a new Viewcontroller is opened containing the information referentere to the selected item I am unable to make the view open using the method below:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Muro selecionado
NSInteger linha= indexPath.row;
Muro *c =[Muros objectAtIndex:linha];
//navega para a tela detalhes
DetalhesMuroViewController *detalhes = [[DetalhesMuroViewController alloc] init];
detalhes.muro = c;
[self.navigationController pushViewController:detalhes animated:YES];
what I’m doing wrong ?
At this link are all project files Galley.
I tried using the second option and it returns me the following build error
No Visible @interface for "Detalhesmuroviewcontroller" declares the selector "setItem"
The code went something like this
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
DetalhesMuroViewController * detailViewController = [storyboard instantiateViewControllerWithIdentifier:@"Detalhes"];
[detailViewController setItem:[Muros objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:detailViewController animated:YES];
}