Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以右键单击并拖动,因此它会成功自动添加一个 IBOutlet 但仅在第一个视图控制器中。我可以右键单击并拖动,但它不会添加 iboutlet。我该如何解决?
如果您尝试添加的类是控制器的自定义类,则可以添加 @IBOutlet。
在您的情况下,firstViewController 看起来是您视图的自定义类,这意味着 secondViewController 不能。
在这个例子中,我只能将@IBOutlet 添加到我的 LoginViewController,如果我尝试添加其他类,XCode 不会让我这样做。