'override'只能在类成员上指定

时间:2015-08-03 06:45:30

标签: xcode6

我收到与'覆盖功能'有关的错误消息。似乎是说'viewWillAppear'不是类成员。

有谁能告诉我如何解决这个问题?

import UIKit
import AVFoundation
import CoreData

class SoundListViewController: UIViewController, UITableViewDataSource,     UITableViewDelegate {

@IBOutlet weak var tableView: UITableView!    
var audioPlayer = AVAudioPlayer()    
var sounds: [Sound] = []

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    self.tableView.dataSource = self
    self.tableView.delegate = self

    override func viewWillAppear(animated: Bool) { // 'override' can only be specified on class members
        self.tableView.reloadData()
    }
}

0 个答案:

没有答案