ios - Type 'ProfilesTableViewController' does not conform to protocol 'UITableViewDataSource' in Xcode 6 GM seed -
today migrated xcode 6 gm seed , following error:
type 'profilestableviewcontroller' not conform protocol 'uitableviewdatasource'.
i've overrided numberofrowsinsection, cellforrowatindexpath , numberofsectionsintableview.
in fact worked fine till today. noticed when remove uitableviewdatasource working fine, , no errors occured. .. necessary use 'uitableviewdatasource' anymore, or override functions it?
this code compiles fine:
class profiletableviewcontroller: uitableviewcontroller, uitableviewdelegate, uitableviewdatasource { override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return 1 } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell: uitableviewcell = tableview.dequeuereusablecellwithidentifier("foo", forindexpath: indexpath) uitableviewcell return cell } } so, can subclass uitableviewcontroller , define uitableviewdatasource protocol implementation.
take notice using override keyword , not using auto-unwrapped arguments -- i.e., not this:
override func tableview(tableview: uitableview!, numberofrowsinsection section: int) -> int { which correct in previous xcode 6 betas.
Comments
Post a Comment