Re: NSString equivalent of CFSTR macro?
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