Swift/PHP How to display mysql data (json) in UITableView using Alamofire

巧了我就是萌 提交于 2019-12-06 05:58:58

The problem is that numberOfSectionsInTableView and numberOfRowsInSection are defined as methods inside getData. If you pull them out of the getData method, they should be called successfully. Note, when you pull them out, the compiler should now complain that you need to add override (like you have for cellForRowAtIndexPath).


My original response based upon standard table view issues is below.


Two possible issues are:

  1. Failure to specify the table view's delegate:

    If this was the case, your UITableViewDataDelegate methods will not get called at all. Put breakpoints/log statements in those routines and confirm they're getting called. If not, confirm that the table view's delegate and data source properties have been set properly.

  2. Failure to hook up the @IBOutlet references in the UITableViewCell subclass to the prototype cell.

    If this was the case, the custom cell properties, e.g. cell.profileID, etc., will be nil in cellForRowAtIndexPath. If they are nil, then go back to Interface Builder and hook them up.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!