带有 iOS 5 的 Xcode 4.2 中的新“对象库”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8444847/
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-14 22:42:51  来源:igfitidea点击:

New "objects library" in Xcode 4.2 with iOS 5

iphonexcodexcode4ios5xcode4.2

提问by A for Alpha

I am using Xcode 4.2 build 4C199(for MAC OSX 10.6.8). I create a new project and select the AppDelegate.h .m file and close the file. When I reopen the file I see a set of objects in the Objects Library in the Utilities panel that are either new or different. There are many more objects than usual. I'd like to use them, but when I click on either a .xib file or a storyboard file the new objects are replace by the normal old objects .Is there a way to access these new objects? Please refer my screenshots below.

我正在使用 Xcode 4.2 build 4C199(对于 MAC OSX 10.6.8)。我创建一个新项目并选择 AppDelegate.h .m 文件并关闭该文件。当我重新打开文件时,我会在“实用工具”面板的“对象库”中看到一组新的或不同的对象。有比平常更多的对象。我想使用它们,但是当我单击 .xib 文件或故事板文件时,新对象会被普通的旧对象替换。有没有办法访问这些新对象?请参考我下面的截图。

enter image description hereenter image description hereenter image description here

在此处输入图片说明在此处输入图片说明在此处输入图片说明

回答by tonklon

These are objects, that are only available on the Mac platform. Please make sure you really created a project targeting the iOS platform. Have a look at the base SDK. It should specify an iOS SDK.

这些是仅在 Mac 平台上可用的对象。请确保您确实创建了一个针对 iOS 平台的项目。查看基本 SDK。它应该指定一个 iOS SDK。

If something went wrong there just create a new project using the right template.

如果出现问题,只需使用正确的模板创建一个新项目。

回答by cshavit

My project is iOS. I upgraded Xcode 4.3 to 4.3.3 last night and had the same problem on my first launch of Xcode after the upgrade: the object library contained only OSX objects.

我的项目是iOS。我昨晚将 Xcode 4.3 升级到 4.3.3,升级后我第一次启动 Xcode 时遇到了同样的问题:对象库只包含 OSX 对象。

It certainly looks like an Xcode bug. My workaround: in the Build Settings, I changed the "iOS Deployment Target" pulldown to a different SDK, then changed it back. After that, I got the iOS objects back.

它当然看起来像一个 Xcode 错误。我的解决方法:在构建设置中,我将“iOS 部署目标”下拉菜单更改为不同的 SDK,然后将其更改回来。之后,我取回了 iOS 对象。

See also here.

另请参见此处