gpt4 book ai didi

ios - 无法弄清楚为什么 Xcode 模拟器无法正常工作

转载 作者:行者123 更新时间:2023-11-28 08:11:35 24 4
gpt4 key购买 nike

screenshot of the story board我是一名新学生,正在 Udemy.com 快速学习 ios 开发。我正在按照其中一个示例创建一个可以将屏幕颜色从白色变为红色的按钮;但是,我不明白为什么 ios 模拟器没有向我显示应该发生的情况。相反,它只是向我显示黑屏。提前谢谢你。 screenshot of the ios simulator after launched

import UIKit

class ViewController: UIViewController {

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



}

@IBOutlet weak var myBotton: UIButton!

@IBAction func MyBottonClicked(_ sender: UIButton) {
self.view.backgroundColor = UIColor.red
}

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

最佳答案

我认为模拟器没有问题,你的 socket 或 Action 连接有问题。确保您的导出或操作已连接到 Storyboard中的 View 。

您必须注意的另一件事是为 Storyboard设置入口点。你说的黑屏一般都是这些原因造成的

enter image description here

关于ios - 无法弄清楚为什么 Xcode 模拟器无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43624538/

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