gpt4 book ai didi

ios - 在新的 ViewController 中声明时出现 Serval 问题/错误

转载 作者:行者123 更新时间:2023-11-30 13:28:48 25 4
gpt4 key购买 nike

Swift 2、xcode7

在我的项目中添加了第二个 ViewController。第一个 View Controller 使用几乎相同的代码行。

出现这些错误:

Getter for 'tableView' with Objective-C selector 'tableView' conflicts with getter for 'tableView' from superclass 'UITableViewController' with the same Objective-C selector

Overriding let must be as accessible as its enclosing type

Cannot override mutable property 'tableView' of type 'UITableView!' with covariant type 'UITableView'

这是我的代码:

import UIKit
import CoreData

class AllChatsViewController: UITableViewController {

var context: NSManagedObjectContext?

private var fetchedResultsController: NSFetchedResultsController?

private let tableView = UITableView(frame: CGRectZero, style: .Plain)//errors are here


private let cellIdentifier = "MessageCell"

谁能帮忙解决这个问题吗?

最佳答案

Beywulf 是对的,我将 VC 更改为 TVC,现在可以使用了

关于ios - 在新的 ViewController 中声明时出现 Serval 问题/错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36818096/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com