Thought I\'d try my hand at iOS development since the Swift/ios8 announcement and I\'m having trouble getting a basic tableView to build.
Currently getting the following
It appears that your table's data source is not set to your ViewController class:
-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xb20fcf0
Double check to make sure you've set up your XIB file/Storyboard properly.
As indicated in the first line of your dump, you're trying to send ...numberOfRows...
to an object of class UIViewController
but that method is only implemented in your subclass.
In your nib file you need to change the class of your view controller from UIViewController
(the default) to ViewController
.
Open your storyboard (or nib file) select the controller itself (it has an icon at the bottom (or top in Xcode 6) that will say "View Controller" when you mouse over it.
Then select the 3rd icon from the properties panel and up at the top where it says "Custom Class" enter "ViewController"
Change your code to:
override func tableView(tableView: UITableView?, numberOfRowsInSection section: Int) -> Int {
// Return the number of rows in the section.
return 10
}