• 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
NSString constant and how to export them
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString constant and how to export them


  • Subject: NSString constant and how to export them
  • From: Romain Brestac <email@hidden>
  • Date: Fri, 1 Sep 2006 21:29:46 +0200

Hello list,

I have a framework where I define some NSString constants. When a class imports my framework's header, I would like this class to be able to use these constants.
What I did: I declare my constants directly in the header because they are specific to the class: NSString *const MYCONSTANTSTRING;


Now, I need to set a value for MYCONSTANTSTRING and reuse it both in the framework class AND in the app that link against this framework.

So the question is : where do I set the value ?

- When I set it in the framework' s principal class header (not the interface), the compiler says something like : ' ... redefinition of MYCONSTANTSTRING'. Note that I export the header into my application controller.
- If I set the value in the interface or the implementation, I can't use it outside of the this instance.


What I want to do is basically the same thing any Apple Framework do when it defines a constant string.

Thanks. Romain.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString constant and how to export them
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: Using #define's in .m files
  • Next by Date: Viewing (long) variable as FourCharCode
  • Previous by thread: Re: Shark and dSYM
  • Next by thread: Re: NSString constant and how to export them
  • Index(es):
    • Date
    • Thread