Unable to extract JPEG from PHAsset

2017-06-16 Thread Glen Huang
Hi, I'm trying to extract the JPEG data from a PHAsset. I did it like this: let fetchOptions = PHFetchOptions() fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)] let assets = PHAsset.fetchAssets(with: fetchOptions)

Deep linking from 1 tvOS app to another

2017-06-16 Thread Eric E. Dolecki
I have deep linking working, but if I introduce spaces into the URL, it fails. Is this expected or can I do this another way? textfield value "hello my name is Eric" @IBAction func editingEnded(_ sender: Any) { if let supplied = textEntry.text { * //If I don't do this, url is

Re: Release mode bindings crash and release pools

2017-06-16 Thread Jerome Krinock
Quincey is correct that closing of windows in macOS is a complicated, tricky process which may have edge case bugs. Also, although you mentioned invoking -bind: (also known as “manual” binding), you have not mentioned -unbind:. In complicated window controllers, I implement a -tearDownOnce meth

Re: Deep linking from 1 tvOS app to another

2017-06-16 Thread Aandi Inston
Spaces are not legal in a URL. So failure or unpredictable results is expected. See for example discussion here https://stackoverflow.com/questions/497908/is-a-url-allowed-to-contain-a-space On 16 June 2017 at 16:00, Eric E. Dolecki wrote: > I have deep linking working, but if I introduce spaces

Re: Property in class mirrored to user defaults

2017-06-16 Thread Jonathan Taylor
Thankyou Charles and Keary for your replies. I somehow hadn't thought of using NSDefaults as backing for the properties. There are a lot of properties involved, but with a macro or something I should be able to set it up without a massive code bloat. Will give that a go. Cheers Jonny On 12 Jun

Re: Deep linking from 1 tvOS app to another

2017-06-16 Thread Eric E. Dolecki
That makes perfect sense. I was talking to a tvOS engineer @ WWDC 2017 and was told I don't have to worry about URLencoding app to app URLs. I thought that sounded weird, tried it, sure didn't work ;) Thanks Aandi. On Fri, Jun 16, 2017 at 12:48 PM Aandi Inston wrote: > Spaces are not legal in a

Re: Release mode bindings crash and release pools

2017-06-16 Thread Quincey Morris
On Jun 16, 2017, at 08:15 , Jerome Krinock wrote: > > Typically the only reason you would explicitly unbind an object is if you > modify the user interface programatically and want to remove a binding. If > you change an objects binding’s values it should first clear any preexisting > values.

Re: Deep linking from 1 tvOS app to another

2017-06-16 Thread Jens Alfke
> On Jun 16, 2017, at 8:00 AM, Eric E. Dolecki wrote: > >let modified = supplied.replacingOccurrences(of: " ", with: "+") Don’t use “+”, use “%20”. The “+” is only valid in some contexts IIRC, like form values. Actually don’t do the substitution by hand. Let NSString URL-encode it

Re: Deep linking from 1 tvOS app to another

2017-06-16 Thread Eric E. Dolecki
Thank you so much! On Fri, Jun 16, 2017 at 3:15 PM Jens Alfke wrote: > > On Jun 16, 2017, at 8:00 AM, Eric E. Dolecki wrote: > >let modified = supplied.replacingOccurrences(of: " ", with: "+") > > > Don’t use “+”, use “%20”. The “+” is only valid in some contexts IIRC, > like form v

Re: Release mode bindings crash and release pools

2017-06-16 Thread Jerome Krinock
> On 2017 Jun 16, at 10:35, Quincey Morris > wrote: > > it takes additional custom code (like in the joystick example) to implement > the other direction. At least, that’s what I’ve been saying for years, though > I don’t think I’ve ever found a developer who believes me. I believe you. I t

Re: Release mode bindings crash and release pools

2017-06-16 Thread Charles Srstka
> On Jun 16, 2017, at 3:27 PM, Jerome Krinock wrote: > >> On 2017 Jun 16, at 10:35, Quincey Morris >> > > wrote: >> >> it takes additional custom code (like in the joystick example) to implement >> the other direction. At least, that’s what I’ve been

Re: Release mode bindings crash and release pools

2017-06-16 Thread Charles Srstka
> On Jun 16, 2017, at 3:48 PM, Charles Srstka wrote: > >> On Jun 16, 2017, at 3:27 PM, Jerome Krinock wrote: >> >>> On 2017 Jun 16, at 10:35, Quincey Morris >>> >> > wrote: >>> >>> it takes additional custom code (like in the joystick example) to im

Re: Release mode bindings crash and release pools

2017-06-16 Thread Quincey Morris
On Jun 16, 2017, at 13:48 , Charles Srstka wrote: > > This is incorrect. It’s incorrect as a 2-way binding, but it works as a pair of so-called 1-way bindings, with the proviso that they may need to be unbound manually, to prevent reference cycles, which it sounds like is what Jerry is doing.

Re: Release mode bindings crash and release pools

2017-06-16 Thread Jonathan Mitchell
> On 16 Jun 2017, at 22:32, Quincey Morris > wrote: > > On Jun 16, 2017, at 13:48 , Charles Srstka wrote: >> >> This is incorrect. > > It’s incorrect as a 2-way binding, but it works as a pair of so-called 1-way > bindings, with the proviso that they may need to be unbound manually, to > p

Re: Release mode bindings crash and release pools

2017-06-16 Thread Quincey Morris
On Jun 16, 2017, at 14:41 , Jonathan Mitchell wrote: > > I sometimes use the default NSObject bind: to set up a simple one way > operation as you describe as opposed to a discrete observation. With macOS 10.13, the new block/closure-based KVO “addObserver” method is probably an easier way, alt

Re: Release mode bindings crash and release pools

2017-06-16 Thread Charles Srstka
> On Jun 16, 2017, at 4:32 PM, Quincey Morris > wrote: > > On Jun 16, 2017, at 13:48 , Charles Srstka > wrote: >> >> This is incorrect. > > It’s incorrect as a 2-way binding, but it works as a pair of so-called 1-way > bindings, with the proviso that they may