views:

92

answers:

1

Hi everyone,

I have a question about the far right column of your Xcode project (image here)

Apple's documentation tells me this about that column:

Target membership. The column marked by the target icon indicates whether the file is included in the active target. If the checkbox next to a file is checked, then the active target includes that file.

So what if I have #import <Security/Security.h> in my .m file, do I still need to link it with the target membership? What if a .m file has that and it's not linked but the code works? Should I remove the line? Should I remove the framework?

Thanks.

A: 

If you don't add it to the target, the compiler won't find the Security framework from the other files compiled under the same target. Targets are in a way separate projects that share some common settings.

MihaiD
So a framework in my Xcode project which has the check box unchecked is the same as not adding it to Xcode? It's only available to my code when I check the check box? Or am I completely wrong?
If you don't add it to any target it's like not having it in your project at all. But by default it should be added to at least one of you targets. And the same goes for any other source code or resource file you may have. You can easily verify that .m files, for instance, are never compiled when not part to the current target.
MihaiD

related questions