Can't change target membership visibility in Xcode 4.5
Asked Answered
W

2

20

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.

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:

enter image description here

What am I doing wrong there?

Wrung answered 26/11, 2012 at 18:41 Comment(0)
P
30

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.

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.

Edit: 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

Pirnot answered 27/11, 2012 at 13:55 Comment(3)
One more thing: you need to add 'Copy headers' in your build phases first. Do it by clicking 'Add build phase' and then selecting 'Copy headers'.Plotkin
Sweet! I just sent the author a pull request updating the README with this information: github.com/jverkoey/iOS-Framework/pull/48Overbear
This has been merged into the master branch, thanks!Valli
W
24

Build Phases -> Add Build Phase -> Copy Bundle Resources (in case you don't have it) Then drag and drop your file there... Good luck ;)

Willemstad answered 27/11, 2013 at 21:25 Comment(1)
underrated answer; this is a great way to do itOxendine

© 2022 - 2024 — McMap. All rights reserved.