Re: Proper way to set up constants when building an iOS framework

2016-04-20 Thread Jens Alfke
> On Apr 20, 2016, at 11:11 AM, Alex Zavatone wrote: > > 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

Re: Proper way to set up constants when building an iOS framework

2016-04-20 Thread Alex Zavatone
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,

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Jens Alfke
> On Apr 19, 2016, at 11:19 AM, Alex Zavatone 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

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Quincey Morris
On Apr 19, 2016, at 12:14 , Ben Kennedy wrote: > > While a trivial detail, this does not seem to be true (at least in Xcode > 7.2). We have a prefix header called "Kashoo_Prefix.pch", and if I hit > cmd-shift-O and type that string, I get a pile of results: first the source >

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Ben Kennedy
> On 19 Apr 2016, at 11:41 am, Quincey Morris > wrote: > > The (built) precompiled header files does *not* have extension “.pch”, While a trivial detail, this does not seem to be true (at least in Xcode 7.2). We have a prefix header called

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Jens Alfke
> On Apr 19, 2016, at 10:13 AM, Alex Zavatone wrote: > > No. I'm simply trying to find out how to make my constants.h (which has the > constants.m as well) visible to all of the classes in my framework, just as > the .pch would be visible to all of the classes within an iOS

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Quincey Morris
On Apr 19, 2016, at 11:41 , Quincey Morris wrote: > > There is a build setting for “Prefix Header” […] Sorry, after I posted, I realized my description was a bit fuzzy. To clarify: — There is a per-target build setting that specifies the *name* of the

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Quincey Morris
On Apr 19, 2016, at 11:27 , Alex Zavatone wrote: > > Sorry this is going on so long, but all I'm looking for is to set up a simple > constants file that works in a framework (and only for my framework) just the > same manner they work within an iOS app. You have the answer

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Alex Zavatone
On Apr 19, 2016, at 2:18 PM, Gary L. Wade wrote: > In a Terminal window, start off with this command: > > find /Applications/Xcode.app/Contents/Developer/Platforms -type f -print0 | > xargs -0 grep FOUNDATION_EXPORT If this would expose my constants outside my framework, this is what I do not

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Alex Zavatone
On Apr 19, 2016, at 1:35 PM, Jens Alfke wrote: > >> On Apr 19, 2016, at 10:20 AM, Alex Zavatone 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

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Gary L. Wade
In a Terminal window, start off with this command: find /Applications/Xcode.app/Contents/Developer/Platforms -type f -print0 | xargs -0 grep FOUNDATION_EXPORT Then go to opensource.apple.com and look around. Note those are zeros, not capital O's if you type the command out vs copy/paste. --

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Alex Zavatone
On Apr 19, 2016, at 1:38 PM, Gary L. Wade wrote: > Another thing I do is add FOUNDATION_EXPORT before my constants in headers, > which will give you the right stuff whether C or C++; C++ name mangling is a > common reason for odd link errors if you include a header in a > C++/Objective-C++

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Gary L. Wade
Another thing I do is add FOUNDATION_EXPORT before my constants in headers, which will give you the right stuff whether C or C++; C++ name mangling is a common reason for odd link errors if you include a header in a C++/Objective-C++ source file. I'm sure you can find examples of this in open

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Jens Alfke
> On Apr 19, 2016, at 10:20 AM, Alex Zavatone 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

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Alex Zavatone
On Apr 16, 2016, at 7:19 AM, Uli Kusterer wrote: > A precompiled prefix header is a compile-time construct that only applies to > the interior of your framework. You can't really tell people linking to your > framework to add a certain prefix header. So you can use a pch for actually >

Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Alex Zavatone
On Apr 18, 2016, at 6:13 PM, Jens Alfke wrote: > >> On Apr 18, 2016, at 2:03 PM, Alex Zavatone wrote: >> >>> Is Constants.h in the framework’s Headers directory, next to the main >>> framework header file? >> >> Where in the project? In target framework's Build Phases Headers

Re: Proper way to set up constants when building an iOS framework

2016-04-18 Thread Jens Alfke
> On Apr 18, 2016, at 2:03 PM, Alex Zavatone wrote: > >> Is Constants.h in the framework’s Headers directory, next to the main >> framework header file? > > Where in the project? In target framework's Build Phases Headers section? Is this in a different project that uses your

Re: Proper way to set up constants when building an iOS framework

2016-04-18 Thread Alex Zavatone
On Apr 15, 2016, at 4:58 PM, Jens Alfke wrote: > >> On Apr 15, 2016, at 1:34 PM, Alex Zavatone wrote: >> >> One thing though. I did do a #import of "Constants.h" into my framework's >> header file and that's not filling the role of what a .pch would fill in a >> standalone

Re: Proper way to set up constants when building an iOS framework

2016-04-16 Thread Uli Kusterer
On 12 Apr 2016, at 19:30, Alex Zavatone wrote: > On Apr 12, 2016, at 12:43 PM, Charles Jenkins wrote: > >> I imagine you’re already doing this, but your message wasn’t clear, so >> forgive me if I sound patronizing. >> >> The constants should be declared extern in the header

Re: Proper way to set up constants when building an iOS framework

2016-04-15 Thread Jens Alfke
> On Apr 15, 2016, at 1:34 PM, Alex Zavatone wrote: > > One thing though. I did do a #import of "Constants.h" into my framework's > header file and that's not filling the role of what a .pch would fill in a > standalone app, even though I thought that someone said it would. >

Re: Proper way to set up constants when building an iOS framework

2016-04-15 Thread Alex Zavatone
Cool. I was thinking of the standard of adding a lowercase k in front of the constants, but wasn't sure if this was canon law or not and wanted to stick with whatever the standard is. One thing though. I did do a #import of "Constants.h" into my framework's header file and that's not filling

Re: Proper way to set up constants when building an iOS framework

2016-04-13 Thread Charles Jenkins
Alex, I suddenly had big fires to put out yesterday and couldn’t respond, but Jens is right. In the .m file but outside of any implementation, define the constant string and assign its value. In the header file just declare the same thing, but with the extern keyword and no value assignment.

Re: Proper way to set up constants when building an iOS framework

2016-04-12 Thread Jens Alfke
> On Apr 12, 2016, at 10:30 AM, Alex Zavatone wrote: > > How should they be initialized in the .m? Within an init method? No, just NSString * const ABC_MY_IMPORTANT_CONSTANT = @"abc"; > Also, I'm quite familiar with the .pch for iOS apps, but are frameworks > allowed a

Re: Proper way to set up constants when building an iOS framework

2016-04-12 Thread Alex Zavatone
On Apr 12, 2016, at 12:43 PM, Charles Jenkins wrote: > I imagine you’re already doing this, but your message wasn’t clear, so > forgive me if I sound patronizing. > > The constants should be declared extern in the header file, but not assigned > any values. The value assignments should appear

Re: Proper way to set up constants when building an iOS framework

2016-04-12 Thread Charles Jenkins
I imagine you’re already doing this, but your message wasn’t clear, so forgive me if I sound patronizing. The constants should be declared extern in the header file, but not assigned any values. The value assignments should appear inside a single .m file in your framework. --  Charles On

Proper way to set up constants when building an iOS framework

2016-04-12 Thread Alex Zavatone
Do you guys have any tips on setting up a constants file when building a framework? I just moved in our SecurityConstants.h and KeychainWrapper, went to build my framework and now it's full of duplicate symbol build errors in the .o files. All the constants are NSString * const and defined in