import UIKit
class MasterViewController: UITableViewController {
var objects = [String]()
var allWords = [String]()
let object = objects[indexPath.row]
cell.textLabel!.text = object
override func awakeFromNib() {
super.awakeFromNib()
}
override func viewDidLoad() {
super.viewDidLoad()
func startGame() {
allWords.shuffle()
title = allWords[0]
objects.removeAll(keepCapacity: true)
tableView.reloadData()
}
if let startWordsPath = NSBundle.mainBundle().pathForResource("start", ofType: "txt") {
if let startWords = NSString(contentsOfFile: startWordsPath, usedEncoding: nil, error: nil) {
allWords = startWords.componentsSeparatedByString("\n") as! [String]
}
} else {
allWords = ["silkworm"]
}
startGame()
/
self.navigationItem.leftBarButtonItem = self.editButtonItem()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
/
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return objects.count
}
}This code that I copied and pasted into the MasterViewController.swift file is below:
let object = objects[indexPath.row]
cell.textLabel!.text = objectThe 2 errors that I get once I put the copied and pasted code into my project are use of unresolved identifier 'indexPath' for the line that starts with let object and expected declaration for cell.textlabel.
Thanks if anyone can help.
Best Regards,
-Comm.Dan