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: Alex Zavatone <email@hidden>
- Date: Wed, 20 Apr 2016 14:11:37 -0400
Bingo. It works. She builds. Constants are found. All is well. Thanks for the collective patience.
I was initially under the assumption that my constants.h file would somehow need to become the pch, since i put my constants in the .h.
I wasn't thinking that I'd make yet another header, (the .pch) to then include the constants header and then it would need to be at the same level in the framework as the constants file or would need to be able to see the path to it in the #import.
The gap in communication was that I was thinking, "OK, I've got the constants.h and constants.m, now what mechanism do I need to use that operates like a .pch does in a straight olden iOS app so that all of my framework's classes can use those constants."
I was thinking that somehow there is a spot that can import that .h or I would have to turn that .h into a pch. What I was missing was that I'd need to create a .pch, that can then see the constants file through a #import.
Thank you all and sorry for the excessive noise.
The framework is now happy with constants and is loading custom subclasses and their xibs and assets and code and the world is temporarily a calm and wonderful place.
Alex Zavatone
On Apr 19, 2016, at 3:47 PM, Jens Alfke wrote:
>
>> On Apr 19, 2016, at 11:19 AM, Alex Zavatone <email@hidden> wrote:
>>
>> 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?
>
> OH. Now I understand what’s going wrong — you’re actually asking how to set up a prefix header for a target.
>
> Make a .pch file. Enter something like
> #import <Foundation/Foundation.h>
> #import "Constants.h"
> Go to the target build settings.
> Use the filter field to search for “prefix header” (it’s under “Apple LLVM - Language”). *
> Set the value to the path to your .pch file (relative to the project directory).
> You probably want to enable Precompile Prefix Header.
>
> —Jens
>
> * The target might already have a prefix header set. In that case you can just edit that one instead. Or delete it and set the path to your own.
_______________________________________________
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