UITableView Won't Load(Sorry New to Coding)

I'm developing an app that has a Tableview that fetches profiles from firebase based on the the profiles' location.
The location data of the profiles are queried through geofire. When the app view loads, the tableview just doesn't get filled.

I've flagged the code at multiple points but just can't figure out the reason.

I know the question is hard to answer without seeing my actual code, but what are some common reasons with a table won't get filled with data from firebase?
Hello,

vague question, but I'll try my best

UIKit - as you wrote tableView(UIKit) :)
If the fetching operation is asynchronous, then it might be beneficial to reload the tableView in the completion block
Code Block
tableView.reloadData()

Also, check whether you're properly supplying the table view with data, i.e dequeue, update and return the cell.

SwiftUI - as the tag says SwiftUI (List)
If you have a model class, that is conforming to ObservableObject protocol, check whether it is properly setting a @Published variable.

There are many ways to achieve a desired result, consider posting a relevant code snippet next time to make it easier for others to help.




https://developer.apple.com/documentation/uikit/uitableview/1614862-reloaddata
https://developer.apple.com/documentation/uikit/uitableviewdatasource

https://developer.apple.com/documentation/combine/observableobject
You should also make sure that you're calling things like reloadData only on the main queue. This is a common mistake when fetching things from the network, because often developers will update their UI in the completion block of a URLRequest, for instance, which is invoked on a background queue by the system.

You can either solve this using Combine by making sure to use .receive(on: RunLoop.main), or by dispatching manually to the main queue using GCD.
A common cause of this is forgetting to set the dataSource and delegate properties on the table view.
UITableView Won't Load(Sorry New to Coding)
 
 
Q