On Apr 19, 2016, at 1:35 PM, Jens Alfke wrote:

> 
>> On Apr 19, 2016, at 10:20 AM, Alex Zavatone <z...@mac.com> wrote:
>> 
>> So, since we have to create a constants file in a framework with .h and .m 
>> files, I've never seen a .m compliment to a .pch.  I have no idea how this 
>> would work at all or how I would be able to set this up.
> 
> I’m not sure why you keep bring up .pch files — they really have nothing to 
> do with frameworks. A prefix header is simply a convenience that 
> automatically #imports a header before compiling every source file in a 
> target.

Because that type of functionality is what I want to be able to have for all 
the classes inside my framework.  

That's EXACTLY what I want,.  It is the example of the functionality li desire.

> 
> If you want every source file in your app to import the framework’s header, 
> then just add #import <Framework/Framework.h> to the app target’s existing 
> .pch.

You're misunderstanding what I'm asking for.  I need the framework's internal 
classes to be able to see all the constants defined in constants.h and 
constants.m without me importing the constants.h file in every class within my 
framework.

I don't care about what the app that links to my framework sees.  I'd prefer 
that the app that uses the framework NOT have access to the internals.

> 
> If you want the source files in the framework to have access to some header, 
> then just include the header in the framework’s .pch.

There is no framework .pch.

How might I create one that the framework knows how to use?  Should I create 
some .pch, then include the constants.h in it?  If so, once I create the .pch, 
where is the setting to tell my framework that it needs to use it?

> 
>> Now, I am trying to get this constants.m imported in one area that will 
>> allow every class within my framework to have access to them.
> 
> You don’t import .m files; they’re not headers. Compile the .m file into the 
> framework and the constants will be part of the framework. Then the 
> framework, and any code linking with it, gets the definitions of the 
> constants.

Oops.  My mistake typing constants.m.  Sorry.

> 
> —Jens

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to