无法更改 Xcode 4.5 中的目标成员身份可见性

Can#39;t change target membership visibility in Xcode 4.5(无法更改 Xcode 4.5 中的目标成员身份可见性)
本文介绍了无法更改 Xcode 4.5 中的目标成员身份可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我目前尝试在我的应用程序中排除我的应用程序内购买逻辑,以使其可在我的其他应用程序中重复使用,甚至将其放在公共 git 存储库中供其他人使用.为此,我遵循了在 XCode 中创建框架的本指南.

I currently try to exclude my In-App Purchase logic in an App of mine to make it reusable in other Apps of mine or even put it on a public git repository for others to use. For this purpose I follow this guide of creating a framework in XCode.

但在 第 2 步我必须将我的 .h 文件的 Target Membership 设置为 public.问题是,在我的 Xcode (v 4.5) 中,单击 .h 文件时看不到任何可见性(当我单击 .m 等其他文件时也看不到任何可见性).看起来是这样的:

But in step 2 I have to set the Target Membership of my .h file to public. The problem is, that in my Xcode (v 4.5) I can't see any visibility when the .h file is clicked (and also not when I click other files like .m ones). It looks like that:

我做错了什么?

推荐答案

我遇到了同样的问题,并在发布一个小时后发现了您的问题,但这是我发现的.在 Xcode 4.4 中,更改头文件的目标成员资格和可见性的功能已被删除,因此本教程将无法按所写的那样工作.

I came across this same problem and found your question an hour after it was posted but here is what I have found. In Xcode 4.4 the ability to change the target membership, and visibility, for header files was removed so this tutorial will not work as written.

您可以将复制标题"构建阶段添加到您在第 1 步中创建的目标(示例中为 Serenity),而不是更改目标成员的可见性.这将有公共、私有和项目标题的 3 个部分.只需单击底部的加号和要在此步骤中公开的标题.默认情况下,它们被放置在 Project 部分,但您可以单击并将它们拖动到 Public 部分.

Instead of changing the target membership visibility you can add a "Copy Headers" build phase to the target you made in step 1 (Serenity in the example). This will have 3 sections for Public, Private, and Project headers. Just click the plus at the bottom and the headers you want to be public to this step. By default they are put in the Project section but you can click and drag them to the Public section.

本教程的其余部分应该可以正常工作.

The rest of the tutorial should work fine from there.

刚刚注意到在我自己的项目中,在添加复制头文件构建步骤之后,可以为头文件选择目标成员身份,因此教程按编写的方式工作.虽然我的框架标题似乎有点奇怪.在任何情况下,在构建阶段更改可见性都会反映在目标成员资格下,反之亦然

Just noticed that in my own project, after adding the copy headers build step, that the target membership can be selected for header files so the tutorial works as written. Though it seems to act a little strange with my framework header. In any case, changing the visibility in the build phase is reflected under target membership and vice versa

这篇关于无法更改 Xcode 4.5 中的目标成员身份可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

iOS framework with dependencies(具有依赖项的 iOS 框架)
UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合单元格表视图静态和动态单元格中处理单元格选择)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中删除 Safari 中的地址栏?)
iOS 5 SDK is gone after upgrade to Xcode 4.5(升级到 Xcode 4.5 后,iOS 5 SDK 消失了)
Having trouble creating UIImage from CIImage in iOS5(在 iOS5 中从 CIImage 创建 UIImage 时遇到问题)
Open target=quot;_blankquot; links outside of UIWebView in Safari(打开目标=“_blank;Safari 中 UIWebView 之外的链接)