问题描述
我目前尝试在我的应用程序中排除我的应用程序内购买逻辑,以使其可在我的其他应用程序中重复使用,甚至将其放在公共 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 中的目标成员身份可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!