Re: PDF image template comes out too small

2016-06-02 Thread David Catmull
OK, if I open the PDFs in Preview, it says that the icons are 8x8 pts instead of 16x16. Exporting at a different DPI in Designer doesn't change this, but if I export from a document that itself has a different DPI (72 vs 144), then that can fix it. So I guess I have at thing or two to learn about w

What type category should I use for my model in Swift?

2016-06-02 Thread Daryle Walker
[Warning: rambling] In Objective-C, you pretty much have to use a class for you model (in your MVC Cocoa app). But in Swift, you have the option to use a struct/enum or a non-NSObject class too. My model in mind is dumb data, so a struct seems appropriate. But your various Cocoa subclass woul

Re: What type category should I use for my model in Swift?

2016-06-02 Thread David Duncan
> On Jun 2, 2016, at 8:55 AM, Daryle Walker wrote: > > [Warning: rambling] > > In Objective-C, you pretty much have to use a class for you model (in your > MVC Cocoa app). But in Swift, you have the option to use a struct/enum or a > non-NSObject class too. > > My model in mind is dumb data,

Re: What type category should I use for my model in Swift?

2016-06-02 Thread Quincey Morris
On Jun 2, 2016, at 08:55 , Daryle Walker wrote: > > My model in mind is dumb data, so a struct seems appropriate. The thing is, though, that Swift value objects are no dumber than reference objects (that is, structs can have behavior just like classes). Conversely, in Swift, the lack of beha

On getting the wrong file type

2016-06-02 Thread Daryle Walker
The NSDocument file handler methods are passed a UTI string of the file's (supposed) type. What error are you supposed to throw when you get an unrecognized UTI? Or can you punt up to super for that default handling? Sent from my iPhone ___ Cocoa-dev

Re: On getting the wrong file type

2016-06-02 Thread Quincey Morris
On Jun 2, 2016, at 12:26 , Daryle Walker wrote: > > The NSDocument file handler methods are passed a UTI string of the file's > (supposed) type. What error are you supposed to throw when you get an > unrecognized UTI? Or can you punt up to super for that default handling? You don’t say which

Re: How can I make NSString.stringEncodingForData fail?

2016-06-02 Thread Daryle Walker
I worked around this by making the encodings list a method argument, defaulted to the values mentioned. Then I could test by running the method with an encoding that I know will fail. Sent from my iPhone > On May 29, 2016, at 3:23 AM, Daryle Walker wrote: > > I'm about to test code that uses

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-06-02 Thread Daryle Walker
But with your way, the method can't be reasonably unit-tested since a NIL may come up randomly. That seems pointless since you can synthesize the string from the other parameters anyway. Sent from my iPhone > On May 30, 2016, at 5:42 AM, Quincey Morris > wrote: > >> On May 29, 2016, at 22:3

Re: On getting the wrong file type

2016-06-02 Thread Daryle Walker
I'm writing about the load- and save-NSData methods of NSDocument that are supplied when selecting a (non-Core Data) Document-based project template. Sent from my iPhone > On Jun 2, 2016, at 3:57 PM, Quincey Morris > wrote: > >> On Jun 2, 2016, at 12:26 , Daryle Walker wrote: >> >> The NSD