gpt4 book ai didi

swift - PFLoginViewController 出现

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

我正在尝试设置要显示的 Parse PFLoginViewController。这是我的一个 View Controller 的类。

import UIKit

import Parse
import ParseUI

class FirstViewController: PFLogInViewController, UITableViewDataSource, UITableViewDelegate, PFLogInViewControllerDelegate {

@IBOutlet weak var tableView: UITableView!

var textArray:NSMutableArray! = NSMutableArray()

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


}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

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


return self.textArray.count
}


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

var cell:UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell


cell.textLabel?.text = self.textArray.objectAtIndex(indexPath.row) as? String

return cell
}
}

我不明白的是,为什么当我运行应用程序时会出现 PFLoginViewController?我没有执行设置代码来使其出现,所以我很困惑为什么它会出现。

我的猜测是,不知何故我的 viewController 被自动替换为 PFLogInViewController ,因为我将它包含在顶部?

我的项目是一个 Swift 应用程序。

最佳答案

您的FirstViewControllerPFLogInViewController(子类)。如果 FirstViewController 是应用窗口的 rootViewController,或者它是容器 View Controller 的第一个/ Root View Controller ,而容器 View Controller 本身就是窗口的 rootViewController >,那么当您运行应用程序时,您将看到 PFLogInViewController

当您在 Swift 中定义类时,冒号后的第一个类型是该类的父类(super class)(或者,如果冒号后的第一个类型是协议(protocol),则您的类是不从父类(super class)继承的根类) .

关于swift - PFLoginViewController 出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31859999/

25 4 0
文章推荐: xcode - 如何在 Xcode 中将 NSClickGestureRecogniser 与 Swift 一起使用?
文章推荐: javascript - Angular 路由问题 - 路由未执行
文章推荐: javascript - 使用 jQuery 获取