ios - How to insert cell into UITableViewController -
i'm creating ipad app. root uitableview has right bar button item in navigation controller. when tap button, shows pop on controller. popover uitableviewcontroller. when tap cell in popover, how pass data in cell , insert cell root uitableview? searched apple docs , couldn't find needed. can push me in right direction?
roottable.h
@interface roottable : uitableviewcontroller<popoverdelegate>
popover.h
@protocol athleteselectpopoverdelegate <nsobject> @required -(void)selectedobject:(object *)newobject; @end @property (nonatomic, weak) id<popoverdelegate> delegate; @property (readwrite, nonatomic) object *currentobject; @end
popover.m
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { _currentobject = [_objectarray objectatindex:indexpath.row]; //notify delegate if exists. if (_delegate != nil) { [_delegate selectedobject:_currentobject]; } }
you add data selected cell main table's data source delegate.
then data source should tell main table cell has been inserted @ index path.
Comments
Post a Comment