Я получаю сообщение об ошибке IBoutlet tableView, говорящий «не может переопределить хранимое свойство tableView». Я не совсем уверен, что это значит, любая помощь будет оценена. импорт UIKitВид таблицы не работает
class UsersViewController: UITableViewController {
@IBOutlet var tableView: UITableView!
var users = ["Marc", "Mark" , "Louise", "Ahinga", "Amossi", "Kalenga"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(tableView:UITableView, numberOfRowsInSection section:Int) -> Int {
return 3
}
override func tableView(tableView:UITableView, cellForRowAtIndexPath indexPath:NSIndexPath) -> UITableViewCell {
let cell = self.tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! userCell
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
}
}
Это не должно быть. «UITableViewController» соответствует по умолчанию с помощью 'UITableViewDelegate' и' UITableViewDataSource', а его «tableView» установлен на него. – catalandres