ios - How to pause at cellForRowAtIndexPath -
i have tableview x number of sections, each 1 row. in each row there uielements take input. input comes core data. have appended input arrays, , indexed arrays, want set them directly/individually in cellforrowatindexpath. since cd fetch takes time complete, need "pause" cellforrowatindexpath (until coredata fetch has sent nsnotification finished.) how can pause , set uilabels etc when fetch done. need each section.
any appreciated ! thank you.
i fear code confuse, feel free ignore it.
func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { var cell = tableview.dequeuereusablecellwithidentifier("cell") uitableviewcell let dashboardcell = celllist.sharedinstance.dashboardcell[userindexforitem[indexpath.section]] dasboardcell dashboardcellglobalvariablesinstance.value = dashboardcell.cdfetchobject.querycdvalue() <--pause , wait nsnotification let value = cell.contentview.viewwithtag(5) uilabel value.text = dashboardcellglobalvariablesinstance.value <-- more ui elements --> return cell }
you need restructure approach. fill each cell data have, yes, do not want block ui while you're awaiting notification.
when receive completion notification, store data in question datasource appropriately reload tableview data (the correct answers how, where, when app-dependent).
from uitableview class reference (https://developer.apple.com/library/ios/documentation/uikit/reference/uitableview_class/):
reloading table view
- reloaddata
- reloadrowsatindexpaths:withrowanimation:
- reloadsections:withrowanimation:
- reloadsectionindextitles
Comments
Post a Comment