i've grouped uitableview
several custom cells placed text fields. have defined property pointing text field active:
- (void)textfielddidbeginediting:(uitextfield *)textfield { self.activetextfield = textfield; } - (void)textfielddidendediting:(uitextfield *)textfield { self.activetextfield = nil; }
i need row , section of cell containing such text field. tried this:
uitableviewcell *parentcell = (uitableviewcell *)[self.activetextfield superview]; nsindexpath* cellpath = [self.tableview indexpathforcell:parentcell]; nsinteger cellrow = [cellpath row];
but 0. looks parentcell
not uitableviewcell
(but should be). how can values?
thanks
if adding text view cell's container view have call self.activetextfield.superview.superview
. if not, self.activetextfield.superview
should work.
in order find out if text field added container view's cell:
- if add text field xib/storyboard custom cell in contentview
- if
[cell addsubview:]
in cell's view - if
[cell.cotentview addsubview:]
in container view.
Comments
Post a Comment