• 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: 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

References: 
 >NSString equivalent of CFSTR macro? (From: Rick Mann <email@hidden>)
 >Re: NSString equivalent of CFSTR macro? (From: Ben Kennedy <email@hidden>)
 >Re: NSString equivalent of CFSTR macro? (From: Rick Mann <email@hidden>)
 >Re: NSString equivalent of CFSTR macro? (From: Ben Kennedy <email@hidden>)

  • Prev by Date: Re: NSString equivalent of CFSTR macro?
  • Next by Date: Re: NSString equivalent of CFSTR macro?
  • Previous by thread: Re: NSString equivalent of CFSTR macro?
  • Next by thread: Re: NSString equivalent of CFSTR macro?
  • Index(es):
    • Date
    • Thread