Re: Stopping on a system call and determining open files?

2017-12-04 Thread Rick Mann
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

NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
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(

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Ben Kennedy
> 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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
> 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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Ben Kennedy
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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
> 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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
> 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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Greg Parker
> 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

Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
> 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

Zooming Breaks Focus-ring Architecture (10.13.1)

2017-12-04 Thread Joel Norvell
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