Search code examples
xcodetarget

Target Membership grayed out ( disabled )


I'm trying to create a new unit test build target for my iphone app. The problem I'm running into is that my source code "group"'s Target Membership options are grayed out.

I did delete the original "Classes" folder, and created new "SourceCode" folder with an actual disk structure (thanks xcode). I imported it as a group, not a folder. It added automatically to my standard build target's Compile Sources, but I can't add it or drag it into my new target.

Any thoughts?

alt text http://img.skitch.com/20100118-mhurmqc33ecaq4xq3y2e5k3hs4.jpg


Solution

  • cdespinosa's answer is on the right track, but not really correct. The sources actually do go into the unit test target, but you only need to include the ones covered by tests.

    I figured it out, and the issue is actually that if a group contains any file that cannot be included (header files for example), the Info dialog is not smart enough to only deal with those files and just locks you out. You have to manually select each .m file, even if you want to include everything in the group. If you have a huge project, I would suggest making a "smart group" (as opposed to xcode's normal "dumb group"), which will let you filter only .m files.

    Why you ask? Why is xcode able to figure this out when you import a bunch of files, some of which cannot be included in the build, but unable to make the same distinction for existing files? Good question. Par for the xcode course, imo.