Xcode 4:缺少带有 Storyboard 的文件所有者?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14126825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:26:57  来源:igfitidea点击:

Xcode 4: Missing File's Owner with Storyboard?

iphoneiosxcodestoryboarduiapplicationdelegate

提问by jww

I started a new project under Xcode 4.5. I accepted the default wizard settings, which included a storyboard.

我在 Xcode 4.5 下开始了一个新项目。我接受了默认的向导设置,其中包括一个故事板。

I went to make connections and the File's Owner is missing.

我去建立连接,但文件的所有者丢失了。

I'm not sure what I did to end up in this configuration. As far as UI components, I added a scroll view in place of the original view. I had some trouble with Vertical Constraints, but I did not do anything drastic.

我不确定我做了什么才能最终得到这个配置。至于 UI 组件,我添加了一个滚动视图来代替原始视图。我在垂直约束方面遇到了一些麻烦,但我没有做任何激烈的事情。

I tried to Google for the issue, but only got back two results: http://www.google.com/#q=xcode+4+%22missing+file+owner+%22.

我试图用谷歌来解决这个问题,但只得到了两个结果:http://www.google.com/#q=xcode+4+%22missing+file+owner+%22

Xcode 4 and Missing File's owner

Xcode 4 和丢失文件的所有者

How does one go about adding a file's owner to a storyboard.

如何将文件的所有者添加到故事板。

UPDATE: For others who find this Stack Overflow article, its time to do Apple App's 101 again: Creating Your First iOS App. It looks like Hillegass and LeMarche have not yet caught up with the 6.0 SDK. There are no books on Amazon as of January, 2013.

更新:对于找到这篇 Stack Overflow 文章的其他人,是时候再做一次 Apple App 的 101:创建你的第一个 iOS 应用程序。看起来 Hillegass 和 LeMarche 还没有赶上 6.0 SDK。截至 2013 年 1 月,亚马逊上没有任何书籍。

回答by Atif Azad

There is nothing called File's Ownerin story boards. File owner's job should be done by View Controllerin your case. If you have to connect IBOutlets and IBActions, connect them with View Controllerin the same way as you did with File Ownerin xib

File's Owner故事板中没有任何内容。View Controller在您的情况下,文件所有者的工作应该由您完成。如果你要连接IBOutletS和IBActionS,它们与连接View Controller在像你一样用同样的方式File Ownerxib

回答by Levi

I assume you are used to nib files. Here, you just have to select the ViewControllerand set it's class in the right side of the screen, to your own custom class. About the constraints, they can be disabled by unchecking the Use Autolayoutoption in the first tab.

我假设您已经习惯了 nib 文件。在这里,您只需ViewController在屏幕右侧选择并将其设置为您自己的自定义类。关于约束,可以通过取消选中Use Autolayout第一个选项卡中的选项来禁用它们。

回答by smileBot

I wanted to add a little gotcha in xcode 5 (don't think it's in earlier versions). Basically the file's owner is called "custom class" in the identity inspector. This can be hidden! Which might confuse someone. I don't think I noticed this in v4.

我想在 xcode 5 中添加一些问题(不要认为它在早期版本中)。基本上,文件的所有者在身份检查器中称为“自定义类”。这个可以隐藏!这可能会让某人感到困惑。我想我在 v4 中没有注意到这一点。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明