ios - Having Trouble to select row in UITableviewCell -
friend i've been trying set default checkmark in uitableview cell,here code please @ this, i'm having serious problem want output
-(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nsstring *cellident = @"cell1111"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellident]; if (tableview==_shapeselectiontable) { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [_shapeselectiontable dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } if([_selectedshapearray containsobject:[_shapearray objectatindex:indexpath.row]] || [_selectedshapearray containsobject:@"check all"]) { cell.accessorytype = uitableviewcellaccessorycheckmark; } else { cell.accessorytype = uitableviewcellaccessorynone; } (nsstring *s in _shaperesultarray) { (int i=0; i<self.shapearray.count; i++) { nsindexpath *myidx=[nsindexpath indexpathforrow:i insection:0]; shapeinfo *shap=[self.shapearray objectatindex:i]; if ([shap.shape isequaltostring:s]) { cell = [[self shapeselectiontable] cellforrowatindexpath:[nsindexpath indexpathforrow:i insection:0]]; cell.accessorytype=uitableviewcellaccessorycheckmark; //[tableview selectrowatindexpath:myidx animated:true scrollposition:uitableviewscrollpositionnone]; } else { cell.accessorytype=uitableviewcellaccessorynone; } } } shapeinfo *shap=[_shapearray objectatindex:indexpath.row]; cell.textlabel.text=shap.shape; homecoming cell; } i want next output resultinfo , cell should remember accessory type
friends i'm having problem precheckmark(cell accessory) json objects note i'm getting output web in json format help appreciated ..thanks
update when run code getting exception assertion failure in -[uitableview _configurecellfordisplay:forindexpath:], /sourcecache/uikit_sim/uikit-2935.137/uitableview.m:6509 2014-06-24 14:14:24.306 thegemhubapp[2405:60b] terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'uitableview datasource must homecoming cell tableview:cellforrowatindexpath:'*
enter image description here
2935.137/uitableview.m:6509 2014-06-24 14:14:24.306 thegemhubapp[2405:60b] terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'uitableview datasource must homecoming cell tableview:cellforrowatindexpath:'*
i invitee exception happen @ line of code
cell = [[self shapeselectiontable] cellforrowatindexpath:[nsindexpath indexpathforrow:i insection:0]]; you should set break point here , simulate happening.
ios objective-c uitableview
No comments:
Post a Comment