Re: Proper way to set up constants when building an iOS framework
Re: Proper way to set up constants when building an iOS framework
- Subject: Re: Proper way to set up constants when building an iOS framework
- From: Jens Alfke <email@hidden>
- Date: Tue, 19 Apr 2016 10:35:23 -0700
> On Apr 19, 2016, at 10:20 AM, Alex Zavatone <email@hidden> 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.
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.
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.
> 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.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden