• 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: NSString equivalent of CFSTR macro?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString equivalent of CFSTR macro?


  • Subject: Re: NSString equivalent of CFSTR macro?
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 5 Dec 2017 11:15:36 +0000

On 4 Dec 2017, at 22:47, Rick Mann <email@hidden> wrote:
>
> I have to use some C header file that #defines some string constants. Is
> there an equivalent to CFSTR() that constructs NSString literals? E.g.,
>
>
> #define NSSTR(s)                              (@ ## s) <-- magic; this
> doesn't work
> #define kSomeCStringConstant                  "foo"
> ...
> NSSTR(kSomeCStringConstant)

Why not just do

  #define NSSTR(s)  ((NSString *)CFSTR(s))

After all, constant NSStrings are the same as constant CFStrings, right?

Kind regards,

Alastair.

--
http://alastairs-place.net

_______________________________________________

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: 
 >NSString equivalent of CFSTR macro? (From: Rick Mann <email@hidden>)

  • Prev by Date: Zooming Breaks Focus-ring Architecture (10.13.1)
  • Next by Date: Re: Loading very large image files (>10GB)
  • Previous by thread: Re: NSString equivalent of CFSTR macro?
  • Next by thread: Zooming Breaks Focus-ring Architecture (10.13.1)
  • Index(es):
    • Date
    • Thread