Start a new topic
Answered

Swift

i am working on app the need to use the UItableview , but i can't get the data from the collection to be displayed on the table view i need some example or the best way to count the items and display the list of names into tableview .


Best Answer

You'd probably do it the same way you populate a table view from any data source:


1.  Perform your Kinvey query, probably in the view controller's viewDidLoad method.


2.  In the completion handler, assign the results of the query to a property of your UITableViewController subclass.


3.  Call `tableView.reloadData` to refresh. Remember to call `reloadData` in a `dispatch_async` block, because UI updates always have to be done on the main queue. For example:

dispatch_async(dispatch_get_main_queue(), completion: {
    self.tableView.reloadData()
})

 4. Implement `tableView:cellForRowAtIndexPath:IndexPath` to customize the cells.


Pranav ,


 in this issue its fixed already thanks , but unfortunately the other main issue there is no reply from you . 

and i feel i am going to give up with your support , if some one need to help me please check the other ticket i have about the download images in array and why the image did not downloaded when i upload the image by the drag and drop .


Thanks , 

Rami,

Did Edward's suggestion help you? Do you have any more queries?

Thanks,
Pranav
Kinvey Support

 

Answer

You'd probably do it the same way you populate a table view from any data source:


1.  Perform your Kinvey query, probably in the view controller's viewDidLoad method.


2.  In the completion handler, assign the results of the query to a property of your UITableViewController subclass.


3.  Call `tableView.reloadData` to refresh. Remember to call `reloadData` in a `dispatch_async` block, because UI updates always have to be done on the main queue. For example:

dispatch_async(dispatch_get_main_queue(), completion: {
    self.tableView.reloadData()
})

 4. Implement `tableView:cellForRowAtIndexPath:IndexPath` to customize the cells.


1 person likes this
Login or Signup to post a comment