Re: NSString equivalent of CFSTR macro?
Re: NSString equivalent of CFSTR macro?
- Subject: Re: NSString equivalent of CFSTR macro?
- From: Rick Mann <email@hidden>
- Date: Mon, 4 Dec 2017 14:58:29 -0800
Ah, nvm, user error. I'm an idiot. It's not a #defined string. It's:
static const char* const kSomeCStringConstant = "foo";
> On Dec 4, 2017, at 14:56 , Ben Kennedy <email@hidden> wrote:
>
> On Dec 4, 2017, at 2:53 PM, Rick Mann <email@hidden> wrote:
>
>> I tried that. It doesn't work.
>>
>> MCP.m:262:54: Unexpected '@' in program
>
> Weird. I just tried it here, using your exact example, and it worked fine
> under Xcode 9.2. (I slapped it into my iOS app's
> application:didFinishLaunchingWithOptions: as a quick and dirty test.)
>
> #define NSSTR(s) (@ s)
> #define kSomeCStringConstant "foo"
> NSLog(@"foo is %@", NSSTR(kSomeCStringConstant));
>
> Do you have some unusual circumstances in your build environment?
>
> b
>
--
Rick Mann
email@hidden
_______________________________________________
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