問題描述
我目前嘗試在我的應(yīng)用程序中排除我的應(yīng)用程序內(nèi)購(gòu)買邏輯,以使其可在我的其他應(yīng)用程序中重復(fù)使用,甚至將其放在公共 git 存儲(chǔ)庫(kù)中供其他人使用.為此,我遵循了在 XCode 中創(chuàng)建框架的本指南.
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 設(shè)置為 public.問題是,在我的 Xcode (v 4.5) 中,單擊 .h 文件時(shí)看不到任何可見性(當(dāng)我單擊 .m 等其他文件時(shí)也看不到任何可見性).看起來是這樣的:
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:
我做錯(cuò)了什么?
推薦答案
我遇到了同樣的問題,并在發(fā)布一個(gè)小時(shí)后發(fā)現(xiàn)了您的問題,但這是我發(fā)現(xiàn)的.在 Xcode 4.4 中,更改頭文件的目標(biāo)成員資格和可見性的功能已被刪除,因此本教程將無法按所寫的那樣工作.
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.
您可以將復(fù)制標(biāo)題"構(gòu)建階段添加到您在第 1 步中創(chuàng)建的目標(biāo)(示例中為 Serenity),而不是更改目標(biāo)成員的可見性.這將有公共、私有和項(xiàng)目標(biāo)題的 3 個(gè)部分.只需單擊底部的加號(hào)和要在此步驟中公開的標(biāo)題.默認(rèn)情況下,它們被放置在 Project 部分,但您可以單擊并將它們拖動(dòng)到 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.
本教程的其余部分應(yīng)該可以正常工作.
The rest of the tutorial should work fine from there.
剛剛注意到在我自己的項(xiàng)目中,在添加復(fù)制頭文件構(gòu)建步驟之后,可以為頭文件選擇目標(biāo)成員身份,因此教程按編寫的方式工作.雖然我的框架標(biāo)題似乎有點(diǎn)奇怪.在任何情況下,在構(gòu)建階段更改可見性都會(huì)反映在目標(biāo)成員資格下,反之亦然
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
這篇關(guān)于無法更改 Xcode 4.5 中的目標(biāo)成員身份可見性的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!