Re: Swift struggles with arithmetic ?

2015-08-29 Thread Gavin Eadie
> On Aug 29, 2015, at 4:55 PM, Quincey Morris > wrote: > > I think you can assume that the error message is in effect a secondary error. > The expression complexity isn’t the issue, but rather the (internal) path > Swift follows to compile it. .. that seems very wise. I keep getting caught b

Re: Swift struggles with arithmetic ?

2015-08-29 Thread Charles Srstka
> On Aug 29, 2015, at 3:05 PM, Gavin Eadie wrote: > > Apologies if off-topic, but Swift appears a lot on cocoa-dev, so maybe it’s OK > > I’ve been using Swift and moving some Obj-C code over to it, but I’m > concerned that it thinks this is “too complex to be solved in reasonable > time”: > >

Re: Swift struggles with arithmetic ?

2015-08-29 Thread Quincey Morris
On Aug 29, 2015, at 13:05 , Gavin Eadie wrote: > > I’ve been using Swift and moving some Obj-C code over to it, but I’m > concerned that it thinks this is “too complex to be solved in reasonable > time”: > >import Foundation >let y = 1.0 * sin(1.0) + 1.0 * sin(1.0) + 1.0 * sin(1.0) >

Swift struggles with arithmetic ?

2015-08-29 Thread Gavin Eadie
Apologies if off-topic, but Swift appears a lot on cocoa-dev, so maybe it’s OK I’ve been using Swift and moving some Obj-C code over to it, but I’m concerned that it thinks this is “too complex to be solved in reasonable time”: import Foundation let y = 1.0 * sin(1.0) + 1.0 * sin(1.0) +

Re: setting tab stops in swift

2015-08-29 Thread Jens Alfke
> On Aug 29, 2015, at 12:18 PM, Quincey Morris > wrote: > > The second init *is* in the 10.11 Obj-C header, right down the end in the > deprecations section. D’oh, you’re right. I see my mistake now — I had pressed Cmd-Shift-O, typed “inittype:loc”, and it showed a single -initWithType:locat

Re: setting tab stops in swift

2015-08-29 Thread Quincey Morris
On Aug 29, 2015, at 12:03 , Jens Alfke wrote: > > Nope, NSTextTab only has a single initializer — the -initWithTextAlignment > one. (I just looked at both the Mac and iOS headers to make sure.) You’re wrong about this. Both are in the class documentation, but the other one is marked as depreca

Re: setting tab stops in swift

2015-08-29 Thread Jens Alfke
> On Aug 29, 2015, at 11:36 AM, Boyd Collier wrote: > > Thanks very much for the suggestions. Re the possible error in my Obj-C > code: Apple's documentation for NSTextTab shows 2 ways to create an > NSTextTab; the first is initWithType:location: (which is what I used in my > Obj-C code)

Re: Impossible leak warning in OS X init method

2015-08-29 Thread Jens Alfke
That code looks fine to me, and it’s exactly the same style of init method that I use (except that I now use ARC so I don’t have to write the [self release] call.) Is it possible that, in removing details from your code, you left out some detail that’s what’s causing the warning? Do you mind po

Re: setting tab stops in swift

2015-08-29 Thread Quincey Morris
On Aug 29, 2015, at 11:36 , Boyd Collier wrote: > > In my swift code, I’ve tried just about every permutation I can think of to > get the type of tab or alignment that I want, but to no avail. It occurred > to me that perhaps swift 1.2, which is what I’m using, might not work; I’ll > give swi

Re: setting tab stops in swift

2015-08-29 Thread Boyd Collier
Jens, Thanks very much for the suggestions. Re the possible error in my Obj-C code: Apple's documentation for NSTextTab shows 2 ways to create an NSTextTab; the first is initWithType:location: (which is what I used in my Obj-C code) and the second is initWithTextAlignment:location:options:

RE: Impossible leak warning in OS X init method

2015-08-29 Thread Lee Ann Rucker
Have you tried reordering it into something like if (!self) return nil; if (!do_stuff_successfully) { [self release]; return nil; } ... That's our house style and I've never seen an error like yours. From: cocoa-dev-bounces+lrucker=vmware@lists.appl

Impossible leak warning in OS X init method

2015-08-29 Thread Bill Cheeseman
The following initialization code has generated a leak warning in Xcode 4, 5, 6 and 7 beta in a framework of mine for several years. It has never caused an issue in the wild. I would really like to get rid of the warning. Can anybody tell me what I'm doing wrong? @implementation MyObject // sub