• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Proper way to set up constants when building an iOS framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Tue, 12 Apr 2016 13:30:38 -0400

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 inside a single .m file in your framework.

I am not doing that.  But it's what I'm going to be doing now.

So, define them like this:

SecurityDefaults.h

extern NSString * const ABC_MY_IMPORTANT_CONSTANT;

SecurityDefaults.m

How should they be initialized in the .m?  Within an init method?



Also, I'm quite familiar with the .pch for iOS apps, but are frameworks allowed a file like this or is that the myAwesomeFramework.h file?

Thank you sir.   Searching for instructions on how to do this is quite challenging.




_______________________________________________

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


  • Follow-Ups:
    • Re: Proper way to set up constants when building an iOS framework
      • From: Uli Kusterer <email@hidden>
    • Re: Proper way to set up constants when building an iOS framework
      • From: Jens Alfke <email@hidden>
References: 
 >Proper way to set up constants when building an iOS framework (From: Alex Zavatone <email@hidden>)
 >Re: Proper way to set up constants when building an iOS framework (From: Charles Jenkins <email@hidden>)

  • Prev by Date: Re: WKWebView and cookies
  • Next by Date: Re: Proper way to set up constants when building an iOS framework
  • Previous by thread: Re: Proper way to set up constants when building an iOS framework
  • Next by thread: Re: Proper way to set up constants when building an iOS framework
  • Index(es):
    • Date
    • Thread