Welcome, Guest
Username Password: Remember me

SCArrayOfObjectsModel requires setItems to reload data?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: SCArrayOfObjectsModel requires setItems to reload data?

SCArrayOfObjectsModel requires setItems to reload data? 1 year, 3 months ago #1

I am using SCArrayOfObjectsModel, created in viewDidLoad.

The items/objects are loaded from a remote web service in viewWillAppear. When the response is ready I need to modify the data source and reload the table view with the data loaded from the service.

This all works fine... but I have to call setItems on the SCArrayOfObjectsModel in addition to [tableView reloadData] in order to see any changes.

The items is a retained NSMutableArray that lives with the view controller. I would think creating a SCArrayOfObjectsModel with a reference to this NSMutableArray, then calling [tableView reloadData] would be all that was required.

No?
  • fictorial
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 3

Re: SCArrayOfObjectsModel requires setItems to reload data? 1 year, 3 months ago #2

Hi Brian,

As a rule, whenever the values bound to STV change by means that are external to STV, and you need these changes to be reflected in the table view, you must call [tableModel reloadBoundValues] (in addition to [tableModel reloadData] in your case). Please tell me if you need any more help with this.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
Last Edit: 1 year, 3 months ago by tarekskr.

Re: SCArrayOfObjectsModel requires setItems to reload data? 1 year, 3 months ago #3

reloadBoundValues does not work in my case; I'm unsure as to why not.

I have to use setItems to see any change.
  • fictorial
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 3

Re: SCArrayOfObjectsModel requires setItems to reload data? 1 year, 3 months ago #4

Thank you very much Brian for reporting this, I've actually been able to replicate your issue. This will be fixed in our final STV 2.0 release (due by the end of this month).

Thanks again for all your feedback!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
Time to create page: 0.77 seconds