Re: for case and if case (Swift 2)

2015-06-12 Thread Quincey Morris
On Jun 11, 2015, at 17:49 , Roland King wrote: > > for case test.two( let a ) in x I got the answer in the developer forums. You might need to sit down before reading further. The correct syntax for this is: > for case let test.two (a) in x

Re: for case and if case (Swift 2)

2015-06-12 Thread Roland King
> On 12 Jun 2015, at 15:35, Quincey Morris > wrote: > > On Jun 11, 2015, at 17:49 , Roland King > wrote: >> >> for case test.two( let a ) in x > > I got the answer in the developer forums. You might need to sit down before > reading further. The correct syntax for

Going back to non-ARC

2015-06-12 Thread John Brownie
Having worked with ARC code for a long while, I discovered an incompatibility with a library that means I have to convert to non-ARC code. Of course, there's no guidelines for this, so I'm just wondering what the rule is for the dealloc method. I would release all non-nil instance variables, an

Re: Going back to non-ARC

2015-06-12 Thread Ken Thomases
On Jun 12, 2015, at 3:18 AM, John Brownie wrote: > Having worked with ARC code for a long while, I discovered an incompatibility > with a library that means I have to convert to non-ARC code. Before we address the how, let's make sure of the why. What is the nature of this incompatibility? A

Re: Going back to non-ARC

2015-06-12 Thread John Brownie
On Fri Jun 12 2015 18:45:49 GMT+1000 (PGT) Ken Thomases wrote: On Jun 12, 2015, at 3:18 AM, John Brownie wrote: Having worked with ARC code for a long while, I discovered an incompatibility with a library that means I have to convert to non-ARC code. Before we address the how, let's make sur

Re: Another NSTreeController/NSOutlineView/NSIndexPath Question

2015-06-12 Thread Dave
> On 11 Jun 2015, at 16:22, Gordon Apple wrote: > > If you are going to use a data hierarchy, then use a data hierarchy. Look > like you are attempting to use a linear array, which won¹t work. You need > arrays of arrays and you bind the tree controller to the root array. I don’t think you unde

rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Antonio Nunes
Hi, I a trying to find a line within a string. When I write: let match = crashReport.rangeOfString("\nIdentifier:.*\n", options: .RegularExpressionSearch) …I get a match. However, when I write let match = crashReport.rangeOfString(“^Identifier:.*$", options: .RegularExpressionSearch) …which

Re: Going back to non-ARC

2015-06-12 Thread Alex Zavatone
Got a link to the iibrary? On Jun 12, 2015, at 5:00 AM, John Brownie wrote: > On Fri Jun 12 2015 18:45:49 GMT+1000 (PGT) Ken Thomases wrote: >> On Jun 12, 2015, at 3:18 AM, John Brownie wrote: >> >>> Having worked with ARC code for a long while, I discovered an >>> incompatibility with a lib

Re: rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Douglas Davidson
By default those match beginning and end of string. If you use NSRegularExpression, there's an AnchorsMatchLines option to control this behavior. Douglas Davidson > On Jun 12, 2015, at 3:41 AM, Antonio Nunes wrote: > > Hi, > > I a trying to find a line within a string. When I write: > > le

Re: iOS version check

2015-06-12 Thread Steve Christensen
How about something like this? NSInteger majorSystemVersion = UIDevice.mainDevice.systemVersion.integerValue; if (majorSystemValue == 8) AVSpeechUtterance.rate = else AVSpeechUtterance.rate = > On Jun 11, 2015, at 10:23 PM, Quincey Morris > wrote: > > There’s a particular A

Re: 3D file formats

2015-06-12 Thread Michael Paluszek
Dear Rick: We had to write our own obj reader for our VisualCommander product. All of our obj files are text files. Sincerely, Mike Michael Paluszek President Princeton Satellite Systems 6 Market Street, Suite 926 Plainsboro, NJ 08536 Phone: 609 27

Re: 3D file formats

2015-06-12 Thread Peters, Brandon
With SceneKit the files have to be .DAE, I had same issue with .OBJ files from Blender. Can the application that used to create the .OBJ files export to .DAE? --Brandon > On Jun 12, 2015, at 09:39, Michael Paluszek wrote: > > Dear Rick: > > We had to write our own obj reader for our VisualCom

Re: 3D file formats

2015-06-12 Thread Sean McBride
On Thu, 11 Jun 2015 17:05:42 -0700, Rick Mann said: >Preview and QuickLook are able to show me the .obj files my company >creates. But neither SceneKit nor Xcode seem to be able to open them, at >least not directly. OS X 10.10.3 (for eventual use on iOS). > >Is there any way to leverage the suppor

Re: Going back to non-ARC

2015-06-12 Thread Sean McBride
On Fri, 12 Jun 2015 18:18:48 +1000, John Brownie said: >Having worked with ARC code for a long while, I discovered an >incompatibility with a library that means I have to convert to non-ARC >code. That sounds like a bad idea. One could easily imagine that non-ARC will be deprecated one day, j

Re: iOS version check

2015-06-12 Thread David Brittain
You can use NSProcessInfo isOperatingSystemAtLeastVersion On 12 June 2015 at 06:22, Steve Christensen wrote: > How about something like this? > > NSInteger majorSystemVersion = UIDevice.mainDevice.systemVersion.integerValue; > > if (majorSystemValue == 8) > AVSpeechUtterance.rate = > els

Re: Playground

2015-06-12 Thread David Grant
I dug a little further and found that the Xcode beta did not have access through the local firewall. So I set up a rule specifically to “allow" the beta and it seems to be working, for now. > On Jun 11, 2015, at 12:27 PM, Quincey Morris > wrote: > > On Jun 11, 2015, at 12:18 , David Grant <

Re: for case and if case (Swift 2)

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 01:15 , Roland King wrote: > > So you mean the slide lied. The more I think about it, the more I want to believe that the current form is just an oversight, and the intended syntax is what’s on the slide. ___ Cocoa-dev mailing

Re: for case and if case (Swift 2)

2015-06-12 Thread Jens Alfke
> On Jun 12, 2015, at 9:29 AM, Quincey Morris > wrote: > > On Jun 12, 2015, at 01:15 , Roland King wrote: >> >> So you mean the slide lied. > > The more I think about it, the more I want to believe that the current form > is just an oversight, and the intended syntax is what’s on the slide.

Re: iOS version check

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 06:22 , Steve Christensen wrote: > > NSInteger majorSystemVersion = UIDevice.mainDevice.systemVersion.integerValue; On Jun 12, 2015, at 08:11 , David Brittain wrote: > > You can use NSProcessInfo isOperatingSystemAtLeastVersion Thanks for the suggestions. I think I’ll use

Re: iOS version check

2015-06-12 Thread Sean McBride
On Fri, 12 Jun 2015 05:23:08 +, Quincey Morris said: >but there’s no definition of NSFoundationVersionNumber_iOS_9_0 in the >iOS 9 SDK. On OS X at least, they usually don't add them until the next OS version. >In fact, there’s nothing higher than >NSFoundationVersionNumber_iOS_8_1 in the iOS

Re: iOS version check

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 10:16 , Sean McBride wrote: > > It's possible Foundation didn't actually change in those releases. Perhaps Foundation itself did not, but its version number did. 8.3 is 1144.17, while 8.1 is shown in the header as 1141.1. > Also, AVSpeechUtterance isn't in Foundation, so ch

Re: iOS version check

2015-06-12 Thread Steve Christensen
I hadn't seen the NSProcessInfo method before so I took a peek at the header and noticed that it's available as of iOS 8: - (BOOL) isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version NS_AVAILABLE(10_10, 8_0); If your app still needs to run on iOS 7 then using the UIDevice method m

Re: iOS version check

2015-06-12 Thread Sean McBride
On Fri, 12 Jun 2015 17:46:52 +, Quincey Morris said: >I wonder what the best practices are here. It’s possible that this >situation is anomalous, because the API didn’t change, nor the range or >intended meaning of the value being passed. (The speech rate was wrong >in iOS 8 even if you didn’t

Re: Another NSTreeController/NSOutlineView/NSIndexPath Question

2015-06-12 Thread Gordon Apple
Ok, I admit to being confused. Seems like what we are missing is the data model. Your containers must be or at least have an array for storage. Normally, the NSTreeController reflects this model and has the info provided to traverse it. In my case, elements are CoreData objects with parent relation

Re: for case and if case (Swift 2)

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 01:15 , Roland King wrote: > > So you mean the slide lied. One more update on this. I notice that inside a switch statement, the following are equivalent: > case test.two (let a): > case let test.two (a): or more usefully: > case test.three (let a, let

Menu Bar App: [NSStatusItem popUpStatusItem] : Menu shows popupmenu too high

2015-06-12 Thread Dan Stenning
Hi, I have this cocoa code in order to show a menu when a “menu app” or menu-extras icon is clicked on on the menu bar. Only trouble is it pops up on top of my menu-app icon, at the very top instead of right _below_ the menu bar. What am i doing wrong ? here is the code in question:

Re: Going back to non-ARC

2015-06-12 Thread John Brownie
On Fri Jun 12 2015 21:11:26 GMT+1000 (PGT) Alex Zavatone wrote: Got a link to the iibrary? https://github.com/refnum/nano/tree/master John -- John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg Summer Institute of Linguistics | Mussau-Emira language, Mussau Is. Ukarumpa, Eastern Hi

Re: Going back to non-ARC

2015-06-12 Thread Maxthon Chan
You can: 1) Compile the library separately and link it into your code bulk, if the C++ templates are not offending 2) Try to convert the library to ARC, and push your changes upstream 3) Opt out ARC on a few files while retaining ARC on most files > On Jun 12, 2015, at 17:00, John Brownie wrote

Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
News outlets says that Objective-C is quickly falling out of people’s attention and developers are turning away from it to Swift and C++. So what language will you use to code various parts of your new project? Objective-C? Swift 2? C++? Or the good old plain C? For me, it is still Objective-C

Re: iOS version check

2015-06-12 Thread Maxthon Chan
Bottom line, you can check using the Darwin kernel version number which maps to iOS version number as reported using uname(2) sys call which is there since the dawn of iOS. The kernel version number have a roughly one to one relationship with the system version number. There exists a few minor

Re: iOS version check

2015-06-12 Thread Shane Stanley
On 13 Jun 2015, at 4:46 am, Steve Christensen wrote: > > I hadn't seen the NSProcessInfo method before so I took a peek at the header > and noticed that it's available as of iOS 8: > > - (BOOL) isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version > NS_AVAILABLE(10_10, 8_0); > > I

Re: Going back to non-ARC

2015-06-12 Thread Roland King
> On 12 Jun 2015, at 17:00, John Brownie wrote: > > On Fri Jun 12 2015 18:45:49 GMT+1000 (PGT) Ken Thomases wrote: >> On Jun 12, 2015, at 3:18 AM, John Brownie wrote: >> >>> Having worked with ARC code for a long while, I discovered an >>> incompatibility with a library that means I have to c

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Eric Dolecki
I love objective-c and swift. I'll concentrate on swift moving forward but I still have large code bases in obj-c.  Sent from Outlook _ From: Maxthon Chan Sent: Friday, June 12, 2015 8:52 PM Subject: Language options: Objective-C, Swift, C or C++? To: Cocoa-Dev L

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Roland King
> On 13 Jun 2015, at 08:51, Maxthon Chan wrote: > > News outlets says that Objective-C is quickly falling out of people’s > attention and developers are turning away from it to Swift and C++. So what > language will you use to code various parts of your new project? Objective-C? > Swift 2? C+

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread David Grant
Since Swift has come out, I have been using Swift exclusively. IMHO, Swift is the way to go. I think it’s stable at this point. I could see where the changes to the syntax could be confusing or frustrating but having dealt with it since the beginning, to me, its arbitrary. And that’s also based

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 18:31 , Roland King wrote: > > I would start learning Swift. […] It’s where the puck is going at least for > Apple OS programming I strongly agree with you here. At the risk of sounding like I’m suffering from WWDC intoxication, my reaction to what I’ve seen in this week’ v

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
It seemed to me that my decision on start learning Swift this year dodged a bullet here. Still my Swift experience will not start until I built a Swift compiler on Linux. For me the embedded land is still C and C only. In 8-bit land Microchip XC8 for PIC as well as SDCC for Intel 8051 are C onl

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Thomas Wetmore
Swift looks like the future; I now use it for new development; and I am porting old projects to it as time permits. I was leary at first, but once it stopped crashing twenty times a day, and performance began approaching that of Obj-C, I converted. I won’t look back unless Apple does an about fa

Re: Menu Bar App: [NSStatusItem popUpStatusItem] : Menu shows popupmenu too high

2015-06-12 Thread Jerry Krinock
> On 2015 Jun 12, at 14:22, Dan Stenning wrote: > > here is the code in question: Hello, Dan. >[pimpl->getView() setMenu:pimpl->theMenu]; It looks like you’re setting your menu into some kind of view. In contrast, I set it into my status item. Paraphrasing my code, [statusItem s

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Carl Hoefs
2-cent note from an uninformed lurker… I busted my rear for couple of years learning and getting to think in Obj C, and I love the object oriented feel it has, especially compared with the likes of C++ and Java, where object orientation feels like a tacked-on afterthought. Okay, so now there'

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Gary L. Wade
Since Swift is new, it's been designed to handle the "problems" you get with Objective-C's fully dynamic nature. Also, there's only so much you can modify Objective-C before it's no longer a superset of C. You might have heard the reason the caret character was used for blocks is due to it being

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Quincey Morris
On Jun 12, 2015, at 19:32 , Carl Hoefs wrote: > > Okay, so now there's Swift. Ugh. At first glance it looks like a throwback to > Basic (let x =), so it make me shudder. Trust me, that feeling goes away in a few days. > I suppose I'll hold my nose and learn it, but the main question would be

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Roland King
> On 13 Jun 2015, at 10:32, Carl Hoefs wrote: > > Okay, so now there's Swift. Ugh. At first glance it looks like a throwback to > Basic (let x =), so it make me shudder. I suppose I'll hold my nose and learn > it, but the main question would be why? Is there some glaring irredeemable > defici

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Maxthon Chan
Maybe my ID card says I am 22 but I had an early start on programming than most of my peers, so just treat me as a 40-year-old since I have some decades-old die-hard habits accumulated already. My first language ever learned is C actually, and then I spent almost 10 years tackling Visual Basic

NSFontPanel for a modal window

2015-06-12 Thread Kurt Sutter
I have a modal window (run with [NSApp runModalForWindow:]) that sports a view that is a descendant of NSTextView. The view has key focus and text is selected therein. I then bring up the font panel calling [NSFontPanel sharedFontPanel] The font panel comes up, and does not have key focus. When

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Roland King
> On 13 Jun 2015, at 13:16, David Delmonte wrote: > > Lurker here.. 1. My first language was PLAN. (I don’t know if you can even > find reference to it today - it was around circa 1966). I imagine that most > people on this list have projects in progress as the languages evolve and > change.

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Jens Alfke
> On Jun 12, 2015, at 7:32 PM, Carl Hoefs > wrote: > > Okay, so now there's Swift. Ugh. At first glance it looks like a throwback to > Basic (let x =), so it make me shudder. If it’s any help, I can assure you that “let” comes from LISP and has been used in tons of newer functional languages

[OT] correcting mistaken identity

2015-06-12 Thread Michael David Crawford
Ladies and Germs, I configured my gmail to send the following autoresponse just now; I'm sending this to cocoa-dev in hopes that the word might get through to all the potential employers who stumbled across the wrong pages while considering my applications -- Dear Friend, Thank you for

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Britt Durbrow
My $0.02: Swift is too immature to warrant doing anything serious with it yet… it just hasn’t been around long enough to be exercised the way that Objective-C has. This will, however, change with time. And yes, there is something of a chicken-and-egg problem there: if nobody does anything serio