repeating custom cells label swift with core data -
this followup question question asked before. didselectatrow updating multiple cells below reloaded tableview + counter after reading , experimenting after accepted guys answer still having same issue. going try different approach after reading around found use of adding/removing index path having set <nsindexpath>()
var checking.
after experimentation got working check on set <nsindexpath>
problem reason in xcode 7 when try create second array capture integer values related set xcode freezes on indexing. altogether different issue. how go keeping track of not indexpath row counter well? latest code insert/remove indexpaths @ row is:
if indexcount == 1 || indexcount == 2 { countindex.insert(indexpath) } else { countindex.remove(indexpath) }
my latest try try creating dictionary stores indexpath + counter in dictionary var cardcountindexcount = [nsindexpath: int]()
setting in func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) {
cardcountindexcount = [indexpath: cardcount]
. lacking experience on going approach experimental , seems when try recall similar problem. instead of changing text label in didselectatrow trying change in cellforrow method , creating universal variable can store data changes.
i willing admit out of depths on problem have ever worked simple tableviews prior. more guidance appreciated!
the way ended fixing setting relationship in core data, saving quantity of card in core data, , recalling object relationship , quantity func tableview willdisplaycell method showing changes in text in method.
Comments
Post a Comment