Closed nolanRatu closed 11 years ago
Can you please put more explanation to the issue? What exactly do you mean by "pushing data"?
Hi Mosamer
I have images and text that I wish to show in my detail view once a cell has been selected. The first cell selection is correct and shows a name and text of the cell in the detail view, but when i go back to the grid view and select another cell it stays the same as my first cell selection and never changes.
(MMGridViewCell )gridView:(MMGridView )gridView cellAtIndex:(NSUInteger)index { //Get data from data arrays Grant *data = [self.ds objectAtIndex:index];
MMGridViewDefaultCell *cell = [[MMGridViewDefaultCell alloc] initWithFrame:CGRectNull];
cell.textLabel.text = data.grantProvider; cell.backgroundView.backgroundColor = [UIColor colorWithPatternImage:data.providerCellImage]; cell.textLabel.textAlignment = UITextAlignmentLeft;
return cell; }
// ----------------------------------------------------------------------------------
(void)gridView:(MMGridView )gridView didSelectCell:(MMGridViewCell )cell atIndex:(NSUInteger)index { //data Grant *myData = [self.ds objectAtIndex:index];
//name of provider to show in detailView label detailView.providerName = myData.grantProvider;
[self.navigationController pushViewController:detailView animated:YES]; }
Hi,
you should instantiate your detail view controller in didSelectCell:atIndex: and then push it to your navigationController.
Regards, René
Hi
I'm struggling to push data when a cell is selected, in a tableview didSelect it would be
detailViewController.treeData = [self.ds objectAtIndex:[self.tableView indexPathForSelectedRow].row];
what would it be in MMGridview
Thanks