2016-03-14 101 views
0

我是xcode编程新手,遇到此错误。我不确定新更新的xcode希望我在这里做什么,因为它在我升级之前就已经工作了。'FormBaseCell'类型的值没有成员

错误:

Value of type 'FormBaseCell' has no member.

我的代码:

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 

    let rowDescriptor = formRowDescriptorAtIndexPath(indexPath) 

    let formBaseCellClass = formBaseCellClassFromRowDescriptor(rowDescriptor) 

    let reuseIdentifier = NSStringFromClass(formBaseCellClass) 

    var cell: FormBaseCell? = tableView.dequeueReusableCellWithIdentifier(reuseIdentifier) as? FormBaseCell 
    if cell == nil { 

     cell = formBaseCellClass.init(style: .Default, reuseIdentifier: reuseIdentifier) 

     cell?.tableViewController = self // <--error 
     cell?.configure() 
    } 

回答

0

我不知道你来自哪里得到这个代码。我从来没有见过任何人通过所有这些步骤来获得细胞。你应该能够做到这一点:

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 
    // Set up your table and prototype cell on storyboard 
    let reuseIdentifier = "MyCell" 

    var cell: FormBaseCell? = tableView.dequeueReusableCellWithIdentifier(reuseIdentifier) as? FormBaseCell 
    if let cell = cell { 
     cell.textLabel.text = "something" 
    } 
    else { 
     cell = FormBaseCell() 
    } 
    return cell 
} 
相关问题