問題描述
我目前嘗試在我的應用程序中排除我的應用程序內購買邏輯,以使其可在我的其他應用程序中重復使用,甚至將其放在公共 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 中的目標成員身份可見性的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!