ios - Cannot access property in tableviewcell -
i have custom tableviewcells, each thumbnail having gesture recognizer on it, open modal box.
in each tableviewcell there's property containing string.
in method called gesture recognizer, i'm trying access property, looping superviews of gesture recognizer.
- (void)handlelongpress:(uilongpressgesturerecognizer *)longpressgesturerecognizer { //handle press zoomimageviewcontroller *zoomimage = [self.storyboard instantiateviewcontrollerwithidentifier:@"zoomimage"]; uiview *subview = longpressgesturerecognizer.view; while (![subview iskindofclass:[uitableviewcell self]] && subview) { subview = subview.superview; } uitableviewcell *cell = (uitableviewcell *)subview; zoomimage.filename = cell.machinepicture; zoomimage.modaltransitionstyle = uimodaltransitionstylecrossdissolve; [self presentviewcontroller:zoomimage animated:yes completion:nil]; }
in debugger cell object tableviewcellcontroller containing property want access. however, on following line error "property 'machinepicture' not found on object of type 'uitableviewcell *'"
zoomimage.filename = cell.machinepicture;
i don't why property cannot found, while cell seems correct object i'm looking for, containing property want...
the standard uitableviewcell
not contain machinepicture
property, did extend uitableviewcell
class?
use custom class instead, casting accordingly:
myuitableviewcell *cell = (myuitableviewcell *)subview;
Comments
Post a Comment