Reputation: 978
When I try to build in Xcode 6 GM, I get this error:
overriding method with selector "tableview:cellForRowAtIndexPath
override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell? *** {
let cell = tableView!.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath!) as UITableViewCell
var toDoItem:NSDictionary = toDoItems.objectAtIndex(indexPath!.row) as NSDictionary
cell.textLabel?.text = toDoItem.objectForKey("itemTitle") as? String
return cell
}
Upvotes: 1
Views: 2026
Reputation: 42335
The signature for that method changed in Xcode 6 GM. It should be:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
Which would make your function look like:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
var toDoItem:NSDictionary = toDoItems.objectAtIndex(indexPath.row) as NSDictionary
cell.textLabel?.text = toDoItem.objectForKey("itemTitle") as? String
return cell
}
Upvotes: 4