• 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: Using #define a good way for String constants, like enums for NSIntegers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using #define a good way for String constants, like enums for NSIntegers?


  • Subject: Re: Using #define a good way for String constants, like enums for NSIntegers?
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 09 Aug 2011 10:06:56 -0500

On Aug 9, 2011, at 7:58 AM, Jerry Krinock wrote:

> This is how it's usually done:
>
> In a .m, .c or .cpp file,
>
> NSString* const constEntityNameLog = @"Log_entity" ;
>
> and if you need to use this constant in other files, add, in the counterpart header file,
>
> extern NSString* const constEntityNameLog ;

If you don't need to use it in other files, define it as a static.

static NSString* const constEntityNameLog = @"Log_entity" ;

Regards,
Ken

_______________________________________________

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

References: 
 >Using #define a good way for String constants, like enums for NSIntegers? (From: Devraj Mukherjee <email@hidden>)
 >Re: Using #define a good way for String constants, like enums for NSIntegers? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: CGContextShowTextAtPoint doesn't show text
  • Next by Date: Scanning images
  • Previous by thread: Re: Using #define a good way for String constants, like enums for NSIntegers?
  • Next by thread: Re: Using #define a good way for String constants, like enums for NSIntegers?
  • Index(es):
    • Date
    • Thread