相关疑难解决方法(0)

NSIndexPath?在Swift中没有成员名称'row'错误

我正在使用Swift语言和方法创建一个UITableViewController

override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell?
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误

NSIndexPath?在Swift中没有成员名称'row'错误

而且我不明白为什么.

这是我的代码

import UIKit

class DPBPlainTableViewController: UITableViewController {

    var dataStore: NSArray = NSArray()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.dataStore = ["one","two","three"]

        println(self.dataStore)
    }


    // #pragma mark - Table view data source

    override func numberOfSectionsInTableView(tableView: UITableView?) -> Int {

        // Return the number of sections.
        return 1
    }

    override func tableView(tableView: UITableView?, numberOfRowsInSection section: Int) -> Int {

        // Return the number of rows in the section.
        return self.dataStore.count …
Run Code Online (Sandbox Code Playgroud)

uitableview ios swift

20
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

swift ×1

uitableview ×1