Dear Cocoa-dev People,
The main view of my app can be zoomed by the user. It contains
NSTextView subviews. The NSTextView focus-rings are well-drawn when the
main view is not zoomed. But when it is zoomed, focus rings are not
drawn properly. They are drawn the same size, no matter what the zoom
fa
> On Dec 4, 2017, at 16:14 , Greg Parker wrote:
>
>
>> On Dec 4, 2017, at 3:22 PM, Rick Mann wrote:
>>
>> Ugh...been doing too much Swift (j/k). The right answer to this question is:
>>
>> @(kSomeCStringConstant)
>>
>> This works whether it's a #define or a static const char* const.
>
> T
> On Dec 4, 2017, at 3:22 PM, Rick Mann wrote:
>
> Ugh...been doing too much Swift (j/k). The right answer to this question is:
>
> @(kSomeCStringConstant)
>
> This works whether it's a #define or a static const char* const.
The downsides are:
1. If the library requires that you use the actua
Ugh...been doing too much Swift (j/k). The right answer to this question is:
@(kSomeCStringConstant)
This works whether it's a #define or a static const char* const.
> On Dec 4, 2017, at 15:00 , Greg Parker wrote:
>
>
>> On Dec 4, 2017, at 2:56 PM, Rick Mann wrote:
>>
>>> On Dec 4, 2017, a
> On Dec 4, 2017, at 2:56 PM, Rick Mann wrote:
>
>> On Dec 4, 2017, at 14:55 , Greg Parker wrote:
>>
>>> On Dec 4, 2017, at 2:51 PM, Ben Kennedy wrote:
>>>
On Dec 4, 2017, at 2:47 PM, Rick Mann wrote:
#define NSSTR(s) (@ ## s) <-- magic; this
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 wrote:
>
> On Dec 4, 2017, at 2:53 PM, Rick Mann wrote:
>
>> I tried that. It doesn't work.
>>
>> MCP.m:262:54: Unexpecte
> On Dec 4, 2017, at 14:55 , Greg Parker wrote:
>
>
>> On Dec 4, 2017, at 2:51 PM, Ben Kennedy wrote:
>>
>>> On Dec 4, 2017, at 2:47 PM, Rick Mann wrote:
>>>
>>> #define NSSTR(s)(@ ## s) <-- magic; this
>>> doesn't work
>>> #define kSomeCStringConstant
On Dec 4, 2017, at 2:53 PM, Rick Mann 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
> On Dec 4, 2017, at 2:51 PM, Ben Kennedy wrote:
>
>> On Dec 4, 2017, at 2:47 PM, Rick Mann wrote:
>>
>> #define NSSTR(s) (@ ## s) <-- magic; this
>> doesn't work
>> #define kSomeCStringConstant "foo"
>> ...
>> NSSTR(kSomeCStringConstant)
>
> You'r
I tried that. It doesn't work.
MCP.m:262:54: Unexpected '@' in program
> On Dec 4, 2017, at 14:51 , Ben Kennedy wrote:
>
>> On Dec 4, 2017, at 2:47 PM, Rick Mann wrote:
>>
>> #define NSSTR(s) (@ ## s) <-- magic; this
>> doesn't work
>> #define kSomeCStringConstant
> On Dec 4, 2017, at 2:47 PM, Rick Mann wrote:
>
> #define NSSTR(s) (@ ## s) <-- magic; this
> doesn't work
> #define kSomeCStringConstant "foo"
> ...
> NSSTR(kSomeCStringConstant)
You're close. The preprocessor is removing the quotation marks, brea
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(
It dawned on me that it was probably getting bad data from the network. My
friend (who works on iTunes servers) fixed it on the server side, and that's
why the problem went away (although hopefully they update the client code to be
more robust. I bet if this were written in Swift, this particula
13 matches
Mail list logo