Trigger when cell jump is clicked
In a storyboard-based application, you'll often want to do a little preparation before navigation
The operation is performed when using storyboard.
-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) Sender {
Get the destination view
Detailviewcontroller * DETAILVC = [Segue Destinationviewcontroller];
Get clicked on the cell
Contacttableviewcell * cell = sender;
Get index value
Nsindexpath * Indexpath = [Self.tableview Indexpathforcell:cell];
The value is passed.
Detailvc.string = [self. Marray ObjectAtIndex:indexPath.row];
__weak Contacttableviewcell *celltwo = cell;
__weak Detailviewcontroller *DETAILTWOVC = DETAILVC;
[DETAILTWOVC showtfstringblock:^ (NSString *str) {
Assigns a value to the cell.
CellTwo.aLabel.text = str;
The use of __block to solve circular reference problems in the MRC to prevent reference counting plus 1, in the ARC environment with __weak to solve the circular reference problem, to prevent CELL,DETAILVC hold the object reference count plus one.
DetailTwoVC.view.backgroundColor = [Uicolor Redcolor];
}];
}
Ios--storyboard using block to pass value