I had the same problem: everything would be easy to work in Objective-C, perhaps because we are currently more familiar with this, but in this case the fast is very new, so its error notifications are pretty vague.
While I was running a UITableView based application, and I ran into this problem. I opened the implementation file for UITableView by clicking a command and clicking on UITableView. In the implementation file, we can clearly see that two functions are required for implementation,
- func tableView (tableView: UITableView, numberOfRowsInSection: Int) -> Int
- func tableView (tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
I came to this post and started collecting things while retaining meager knowledge of objective-C programming. The reason for the error is that the table view is determined by two elements, first a section and rows in a section, as well as tableview cells. By default, there is at least one section in the table view, but we need to match the number of rows in the section. Secondly, we need to know which cell we are going to represent in a certain line in the section. Despite this, even if we use the UITableViewCell by default, we still need an identifier to access it in order to set its subviews or properties. I hope this was useful, A bit of soft criticism will be appreciated, as I myself am very new to Swift :)
Muhammad Umar Nov 02 '14 at 8:46 a.m. 2014-11-02 08:46
source share