我一直在我的代码上得到编译错误。我不知道发生了什么。请帮忙!我试图寻找其他论坛,但没有任何帮助我。我使用的解析为我的项目,如果该事项...Swift错误类型'usersVC'不符合协议'UITableViewDataSource'
//
// usersVC.swift
// CaastRun
//
// Created by Computer on 5/23/15.
// Copyright (c) 2015 Caast. All rights reserved.
//
import UIKit
class usersVC: UIViewController, UITableViewDataSource, UITableViewDelegate {
@IBOutlet weak var resultsTable: UITableView!
var resultsNameArray = [String]()
var resultsUserNameArray = [String]()
var resultsImageFiles = [PFFile]()
override func viewDidLoad() {
super.viewDidLoad()
let theWidth = view.frame.size.width
let theHeight = view.frame.size.height
resultsTable.frame = CGRectMake(0, 0, theWidth, theHeight)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableview(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return resultsNameArray.count
}
func tableview(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 64
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell:usersCell = tableView.dequeueReusableCellWithIdentifier("Cell") as! usersCell
return cell
}
}
错别字:'tableview'应该是'tableView'大写V. - 投票关闭作为题外话,因为一个简单的印刷错误。 –