Re: Future of Cocoa #2

2019-12-12 Thread Charles Srstka via Cocoa-dev
> On Dec 10, 2019, at 5:57 PM, Turtle Creek Software via Cocoa-dev > wrote: > > Xojo is new to me, but it appears more a SwiftUI than a Cocoa substitute. Xojo is just the new name for RealBASIC, which has been around forever. It wouldn’t be my first choice. Charles

Re: Need for Swift

2019-10-16 Thread Charles Srstka via Cocoa-dev
> On Oct 16, 2019, at 2:38 PM, Jean-Daniel via Cocoa-dev > wrote: > >> Le 16 oct. 2019 à 11:49, Stephane Sudre via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> a écrit : >> >> On Tue, Oct 15, 2019 at 2:26 PM Sandor Szatmari via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >>>

Re: Need for Swift

2019-10-15 Thread Charles Srstka via Cocoa-dev
> On Oct 14, 2019, at 10:44 PM, Laurent Daudelin via Cocoa-dev > wrote: > > Are people supposed to know instinctively when you unwrap with “?” and when > you do with “!”? It’s quite simple; you nearly always unwrap with `?`. The tiny minority of the time that `!` is needed is when you *know*

Re: Need for Swift

2019-10-14 Thread Charles Srstka via Cocoa-dev
> On Oct 14, 2019, at 7:21 PM, Jens Alfke wrote: > >> On Oct 14, 2019, at 5:02 PM, Charles Srstka > <mailto:cocoa...@charlessoft.com>> wrote: >> >> Swift, on the other hand, can actually *be* a scripting language if you want >> it to; put #!/usr/bin/e

Re: Need for Swift

2019-10-14 Thread Charles Srstka via Cocoa-dev
> On Oct 14, 2019, at 2:30 PM, Jens Alfke wrote: > >> On Oct 14, 2019, at 11:25 AM, Carl Hoefs via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >> I see Computer Science students here falling into two groups. The group that >> likes Swift generally likes scripting languages,

Re: Need for Swift

2019-10-12 Thread Charles Srstka via Cocoa-dev
> On Oct 12, 2019, at 11:24 AM, Charles Srstka wrote: > > The string nil checks, in particular, This was meant to be “The strict nil checks.” Ah, the joy of mailing lists, where there’s no edit feature. Charles ___ Cocoa-dev mailing li

Re: Need for Swift

2019-10-12 Thread Charles Srstka via Cocoa-dev
> On Oct 12, 2019, at 10:55 AM, Pier Bover via Cocoa-dev > wrote: > > Yeah I think Apple saw Obj-C as a barrier for developer adoption. I don't > think that's too far from the truth considering the emphasis on teaching > Swift to young devs, Playgrounds, the marketing about teenagers making >

Re: Thoughts on Cocoa

2019-10-12 Thread Charles Srstka via Cocoa-dev
> On Oct 11, 2019, at 5:29 PM, tblenko--- via Cocoa-dev > wrote: > > Me, I still don’t understand why, given the long history of support at > Apple/NeXT for C++ …what? > and the maturity of the compilers available, there is any need for Swift. But > there it is. Or, there they are. Perhaps

Re: Thoughts on Cocoa

2019-10-11 Thread Charles Srstka via Cocoa-dev
> On Oct 11, 2019, at 12:44 AM, Jens Alfke wrote: > > >> On Oct 10, 2019, at 6:18 PM, Richard Charles via Cocoa-dev >> wrote: >> >> Just a guess but perhaps management had an awakening when they found the >> time and effort expended to write the next even better version of Finder in >>

Re: Thoughts on Cocoa

2019-10-10 Thread Charles Srstka via Cocoa-dev
> On Oct 4, 2019, at 4:51 AM, Jeremy Hughes via Cocoa-dev > wrote: > > Hi Jens, > >> On 3 Oct 2019, at 20:04, Jens Alfke via Cocoa-dev > > wrote: >> >> The people I hear complaining about this are those who, like you, didn't >> move to Cocoa. Carbon was a

Re: Carbon -> Cocoa

2018-08-19 Thread Charles Srstka
> On Aug 18, 2018, at 2:45 PM, Mike Crawford wrote: > > "older OS versions", porting to 10.6 or later vs. 10.10 or later: > > I at first intended all the drivers I write for my clients to work on > Snow Leopard 10.6, but after actually attempting to do so I settled > upon supporting El Capitan

Re: Data, enumerateBytes: separate blocks?

2017-12-25 Thread Charles Srstka
> On Dec 25, 2017, at 12:23 PM, Daryle Walker wrote: > > Not quite. > > My first versions of this idea, pre-Swift and therefore using NSData with > Objective-C, did use the direct search functions that come with the NSData > API. There seems to be a detail you missed in my

Re: Data, enumerateBytes: separate blocks?

2017-12-24 Thread Charles Srstka
> On Dec 24, 2017, at 2:51 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Dec 24, 2017, at 04:45 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> you could consider making it

Re: Data, enumerateBytes: separate blocks?

2017-12-24 Thread Charles Srstka
> On Dec 24, 2017, at 1:03 AM, Daryle Walker wrote: > >> On Dec 22, 2017, at 2:18 PM, Quincey Morris >> > > wrote: >> >> On Dec 22, 2017, at 08:48 , Daryle Walker >

Re: Creating NSTableView programmatically

2017-12-20 Thread Charles Srstka
> On Dec 20, 2017, at 4:23 AM, Quincey Morris > wrote: > >> The original code used all the same three array controllers, with the exact >> same subclassing of the target's one. > > This is where I take the fifth. > > When bindings were introduced, back

Re: Creating NSTableView programmatically

2017-12-11 Thread Charles Srstka
> On Dec 11, 2017, at 4:59 AM, Eric Matecki wrote: > > > Hello, > > I'm trying to implement in Objective-C on macOS *programmatically* the "Real > World Example" at the bottom of this page : >

Re: Is "-init" really needed?

2017-08-10 Thread Charles Srstka
Alastair Houghton <alast...@alastairs-place.net >>> <mailto:alast...@alastairs-place.net>> wrote: >>> >>> On 10 Aug 2017, at 15:09, Charles Srstka <cocoa...@charlessoft.com >>> <mailto:cocoa...@charlessoft.com>> wrote: >>>>

Re: Is "-init" really needed?

2017-08-10 Thread Charles Srstka
> On Aug 10, 2017, at 8:59 AM, Alastair Houghton > wrote: > > On 10 Aug 2017, at 14:57, gerti-cocoa...@bitart.com > wrote: >> >> On Aug 10, 2017, at 02:18, Alastair Houghton >> wrote: >>> >>>

Re: Best practice with NSProgressIndicator

2017-07-28 Thread Charles Srstka
If you’re using Swift, I made a custom replacement for NSProgress that is specifically designed to cut down on CPU time used to update the progress. It allows you to set the granularity for notifications, so that they’ll only update when the progress has changed since the last update by an

Re: Relative URLs, and string encodings

2017-07-24 Thread Charles Srstka
> On Jun 1, 2017, at 9:44 AM, Jonathan Taylor > wrote: > > Can anyone help me with the seemingly simple task of creating a relative > NSURL for a filesystem object? The catch here (sorry!) is that I really do > need backward compatibility to 10.7, which rules

Re: Who owns a child view controller?

2017-07-14 Thread Charles Srstka
> On Jul 14, 2017, at 10:09 AM, Jeremy Hughes > wrote: > >> On 14 Jul 2017, at 14:40, Steve Christensen > > wrote: >> >> On Jul 14, 2017, at 3:50 AM, Jeremy Hughes >

Re: Who owns a child view controller?

2017-07-14 Thread Charles Srstka
> On Jul 14, 2017, at 8:51 AM, Alex Zavatone wrote: > > >> On Jul 14, 2017, at 5:50 AM, Jeremy Hughes >> wrote: >> >>> On 12 Jul 2017, at 17:41, Jens Alfke wrote: >>> On Jul 12, 2017, at 9:34 AM, Jeremy Hughes

Re: Question about structs and enum placement in a project

2017-07-13 Thread Charles Srstka
gt; wrote: > > Perhaps. Then maybe a folder of categorized structs and enums? I personally > dislike seeing them sprinkled throughout AppDelegate & other classes. It's > easy to cntrl-click to where they are defined, but it seems like a lot of > clutter. > > On Thu, Jul

Re: Question about structs and enum placement in a project

2017-07-13 Thread Charles Srstka
For a project of any appreciable size, that’s gonna be one huge file… Charles > On Jul 13, 2017, at 8:37 AM, Eric E. Dolecki wrote: > > I am planning on putting all my structs and enums into it's own swift file > - to keep my project cleaner. Seems safe enough, thoughts on

Re: Who owns a child view controller?

2017-07-13 Thread Charles Srstka
> On Jul 12, 2017, at 6:30 PM, Quincey Morris > wrote: > > On Jul 12, 2017, at 16:19 , Greg Parker > wrote: >> >> "Unowned" means something else in Swift. > > I suppose. I guess I’ve internalized “unowned” to

Re: Who owns a child view controller?

2017-07-12 Thread Charles Srstka
> On Jul 12, 2017, at 1:24 PM, Jens Alfke <j...@mooseyard.com> wrote: > >> On Jul 12, 2017, at 10:38 AM, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >> While that’s true, the main reason, as I under

Re: Who owns a child view controller?

2017-07-12 Thread Charles Srstka
> On Jul 12, 2017, at 12:23 PM, Jens Alfke wrote: > > >> On Jul 12, 2017, at 9:54 AM, Jeremy Hughes >> wrote: >> >> I’d forgotten about autorelease pools - but I guess they’re still there in >> Cocoa for backwards compatibility with pre-ARC

Re: Is cloning the same as copying in APFS?

2017-06-27 Thread Charles Srstka
> On Jun 27, 2017, at 4:45 PM, Rick Mann <rm...@latencyzero.com> wrote: > >> >> On Jun 27, 2017, at 14:30 , Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On Jun 27, 2017, at

Re: Is cloning the same as copying in APFS?

2017-06-27 Thread Charles Srstka
> On Jun 27, 2017, at 4:17 PM, Rick Mann wrote: > > Thanks for that, Charles! > > I wasn't sure because of the existence of the clonefile() call in > , implying that operation was different from copyfile(), but > looking more closely at the sample code, I see that you

Re: Is cloning the same as copying in APFS?

2017-06-27 Thread Charles Srstka
> On Jun 27, 2017, at 12:28 AM, Jens Alfke wrote: > >> On Jun 26, 2017, at 7:38 PM, Rick Mann > > wrote: >> >> But there's actually a POSIX "clone" API, and so I wonder if a copy is >> different from a clone. > > The

Re: Converting a Storyboard into separate NIBs.

2017-06-19 Thread Charles Srstka
> On Jun 19, 2017, at 4:29 PM, Alex Zavatone wrote: > > From line 153 of UIViewController.h: > > As a convenience, the default init method will do this for you, > and specify nil for both of this methods arguments.) In the specified NIB, > the File's Owner proxy should >

Re: Converting a Storyboard into separate NIBs.

2017-06-19 Thread Charles Srstka
> On Jun 19, 2017, at 2:51 PM, Alex Zavatone wrote: > > What is EXCELLENT is when you take the storyboard and remove all the top > level views. Then, create individual XIBs for each scene. The > viewController.h specifies that “if a view can not be found, an .xib with the >

Re: Release mode bindings crash and release pools

2017-06-17 Thread Charles Srstka
> On Jun 17, 2017, at 3:11 PM, Jonathan Mitchell <li...@mugginsoft.com> wrote: > >> On 17 Jun 2017, at 16:36, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On Jun 17, 2017, at 8:36 AM, Jona

Re: Release mode bindings crash and release pools

2017-06-17 Thread Charles Srstka
> On Jun 17, 2017, at 8:36 AM, Jonathan Mitchell <li...@mugginsoft.com> wrote: > >> On 17 Jun 2017, at 14:21, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On Jun 17, 2017, at 5:32 AM, Jona

Re: Release mode bindings crash and release pools

2017-06-17 Thread Charles Srstka
> On Jun 17, 2017, at 5:32 AM, Jonathan Mitchell wrote: > >> On 16 Jun 2017, at 23:18, Quincey Morris >> > > wrote: >> >> On Jun 16, 2017, at 14:41 , Jonathan Mitchell

Re: Release mode bindings crash and release pools

2017-06-16 Thread Charles Srstka
> On Jun 16, 2017, at 4:32 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jun 16, 2017, at 13:48 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> This is incorrect. > &

Re: Release mode bindings crash and release pools

2017-06-16 Thread Charles Srstka
> On Jun 16, 2017, at 3:48 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: > >> On Jun 16, 2017, at 3:27 PM, Jerome Krinock <je...@ieee.org> wrote: >> >>> On 2017 Jun 16, at 10:35, Quincey Morris >>> <quinceymor...@rivergatesoftware.c

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

Re: Property in class mirrored to user defaults

2017-06-12 Thread Charles Srstka
> On Jun 12, 2017, at 4:04 AM, Jonathan Taylor > wrote: > > Hi all, > > This feels like a very basic question, but one that I have not had any luck > searching for (maybe I am using the wrong terms?). > > At the moment I have properties in a (singleton) class

Re: switching text field between editable and non-editable

2017-05-31 Thread Charles Srstka
> On May 31, 2017, at 2:18 PM, J.E. Schotsman <jesc...@xs4all.nl> wrote: > >> On 31 May 2017, at 20:59, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >> Does setting its needsDisplay property to true ha

Re: switching text field between editable and non-editable

2017-05-31 Thread Charles Srstka
> On May 31, 2017, at 1:51 PM, J.E. Schotsman wrote: > > Hello, > > I have a hard time achieving what the message title says. > Depending on user settings I want a text field to be either editable or > non-editable. > > I’ve tried this: > > if makeEditable > {

Re: Question about the Main Thread

2017-04-25 Thread Charles Srstka
> On Apr 25, 2017, at 4:37 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: > >> On Apr 25, 2017, at 9:51 AM, Dave <d...@looktowindward.com> wrote: >> >> Mac Project. >> >> Hi All, >> >> I’m using performSelector: withObject: a

Re: Question about the Main Thread

2017-04-25 Thread Charles Srstka
> On Apr 25, 2017, at 9:51 AM, Dave wrote: > > Mac Project. > > Hi All, > > I’m using performSelector: withObject: afterDelay: in order to postpone > further processing until after the current method/run loop as expired, this > puts the request at the End of the

Re: Translating KVO-ed property to Swift

2017-04-24 Thread Charles Srstka
> On Apr 24, 2017, at 1:17 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Apr 24, 2017, at 10:11 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> What Quincey seemed to be re

Re: Translating KVO-ed property to Swift

2017-04-24 Thread Charles Srstka
> On Apr 24, 2017, at 10:07 AM, Richard Charles <rcharles...@gmail.com> wrote: > >> >> On Apr 23, 2017, at 11:27 AM, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On

Re: Translating KVO-ed property to Swift

2017-04-23 Thread Charles Srstka
Sorry I didn’t get around to replying sooner; I’ve had a busy past few days. > On Apr 20, 2017, at 3:06 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Apr 20, 2017, at 10:24 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa

Re: Translating KVO-ed property to Swift

2017-04-20 Thread Charles Srstka
> On Apr 19, 2017, at 9:12 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Apr 19, 2017, at 15:49 , Charles Srstka <cocoa...@charlessoft.com> wrote: >> >> Cocoa automagically does its secret subclass thing to wrap the setter and &g

Re: Translating KVO-ed property to Swift

2017-04-19 Thread Charles Srstka
> On Apr 19, 2017, at 4:50 PM, Quincey Morris > wrote: > >> 3. Computed properties do not need to be dynamic, […]. > > This is also not exactly true. Computed properties that have only a getter do > not need to be dynamic, because they don’t generate any

Re: Translating KVO-ed property to Swift

2017-04-19 Thread Charles Srstka
> On Apr 19, 2017, at 4:50 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Apr 19, 2017, at 10:56 , Charles Srstka <cocoa...@charlessoft.com> wrote: >> >> 2. Stored properties need to call willChangeValue(forKey:) and >> d

Re: Translating KVO-ed property to Swift

2017-04-19 Thread Charles Srstka
> On Apr 17, 2017, at 7:40 AM, Jean-Daniel wrote: > >> Le 17 avr. 2017 à 10:52, Quincey Morris > > a écrit : >> >> On Apr 17, 2017, at 01:43 , Jean-Daniel >

Re: Translating KVO-ed property to Swift

2017-04-17 Thread Charles Srstka
u cannot guarantee that the property will be called via objc_msgSend, which is important if you’re relying on the swizzled accessor to send the property notifications. If you’re sending them yourself, it doesn’t matter one way or another how the property was called, as long as you add @objc so that cl

Re: Translating KVO-ed property to Swift

2017-04-17 Thread Charles Srstka
> On Apr 17, 2017, at 3:24 AM, Rick Mann wrote: > > I have a number of properties in Objective-C written like this, > short-circuiting notifications when the value doesn't change: > > - > @synthesize version = mVersion > > - (void) > setVersion: (NSString *)

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Charles Srstka
> On Apr 5, 2017, at 4:08 PM, Daryle Walker <dary...@mac.com> wrote: > >> >> On Apr 5, 2017, at 12:19 PM, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >> >> Actually, while NSTableCellVi

Re: What do the font-related Cocoa Bindings in NSTableView and NSTableColumn do?

2017-04-05 Thread Charles Srstka
> On Apr 5, 2017, at 8:38 AM, Keary Suska wrote: > >> >> On Apr 4, 2017, at 4:34 PM, Daryle Walker > > wrote: >> >> >>> On Apr 4, 2017, at 9:57 AM, Keary Suska >>

Re: Is there a way to pluralize menu items?

2017-04-05 Thread Charles Srstka
> On Apr 5, 2017, at 8:10 AM, Steve Mills wrote: > > On Apr 4, 2017, at 22:09:34, Daryle Walker > wrote: >> >> I have a menu item named like “Remove Item”. But I added support for >> multiple-selection in the table-view. So is there

Re: Can't use +initialize, now what?

2017-03-29 Thread Charles Srstka
> On Mar 29, 2017, at 3:41 PM, Greg Parker <gpar...@apple.com> wrote: > >> On Mar 29, 2017, at 9:02 AM, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On Mar 29, 2017, at 10:51 AM, Jens Alfke

Re: Can't use +initialize, now what?

2017-03-29 Thread Charles Srstka
> On Mar 29, 2017, at 10:51 AM, Jens Alfke wrote: > >> On Mar 29, 2017, at 6:57 AM, Daryle Walker > > wrote: >> >> Sometimes, I see something in Apple’s AppKit/Foundation reference site that >> mentions that their technique should

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-23 Thread Charles Srstka
> On Mar 23, 2017, at 3:50 AM, Alastair Houghton > wrote: > > On 22 Mar 2017, at 19:13, Chris Ridd > wrote: >> >>> On 22 Mar 2017, at 09:05, Alastair Houghton >>

Re: Unicode filenames with Apple File System and UIManagedDocument

2017-03-21 Thread Charles Srstka
> On Mar 21, 2017, at 9:13 AM, davel...@mac.com wrote: > >> >> On Mar 21, 2017, at 8:33 AM, Jean-Daniel > > wrote: >> >> >>> Le 21 mars 2017 à 12:03, davel...@mac.com a écrit : >>> On Mar 21, 2017, at 1:06 AM, Jens Alfke

Re: why use extern "C"

2017-03-07 Thread Charles Srstka
> On Mar 7, 2017, at 11:42 AM, Aandi Inston wrote: > > (You should not see // in this section, because in pure C it is forbidden). This is not true with the latest versions of the C standard. Both C99 and C11 support inline // comments. The only case where // is not allowed

Re: curious: if not file references, what?

2017-01-20 Thread Charles Srstka
> On Jan 20, 2017, at 10:24 PM, Quincey Morris > wrote: > > It’s an interesting question whether file-references use inode numbers. Some > file systems don’t have them, so (I assume) they’re invented when such a file > system is mounted, but they’re not

Re: On NSIncrementalStore UUID Uniqueness

2017-01-19 Thread Charles Srstka
> On Jan 19, 2017, at 3:18 PM, Daryle Walker <dary...@mac.com> wrote: > > >> On Jan 16, 2017, at 12:08 PM, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >>> On Jan 14, 2017, at 4:41 AM, Daryl

Re: On NSIncrementalStore UUID Uniqueness

2017-01-19 Thread Charles Srstka
> On Jan 16, 2017, at 12:48 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jan 16, 2017, at 09:08 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> The thing with fi

Re: On NSIncrementalStore UUID Uniqueness

2017-01-16 Thread Charles Srstka
> On Jan 14, 2017, at 4:41 AM, Daryle Walker wrote: > > Could I base the UUID off a hash of the URL? Maybe, but it wouldn’t survive > file moves. There are file references in macOS, which would be more stable, > but I read that there’s a bug in the URL class where it would

Re: What do NSArrayController, etc. do for me?

2017-01-13 Thread Charles Srstka
> On Jan 13, 2017, at 6:39 AM, Daryle Walker > wrote: > > If my data model supports KVC/KVO, it seems like I should be able to bind my > views to my data directly via Cocoa Bindings, without using NSArrayController > or NSObjectController or the like.

Re: What do NSArrayController, etc. do for me?

2017-01-13 Thread Charles Srstka
> On Jan 13, 2017, at 6:39 AM, Daryle Walker wrote: > > If my data model supports KVC/KVO, it seems like I should be able to bind my > views to my data directly via Cocoa Bindings, without using NSArrayController > or NSObjectController or the like. What advantage do those

Re: Opposite of windowDidLoad

2017-01-12 Thread Charles Srstka
> On Jan 12, 2017, at 12:53 PM, Quincey Morris > wrote: > > windowWillClose is an acceptable place to tear down the binding only if (a) > the thing bound, and the thing bound to, still exist, and (b) there is no > chance that the window will be re-opened.

Re: AVSimplePlayer in Swift?

2017-01-08 Thread Charles Srstka
> On Jan 8, 2017, at 1:12 PM, Quincey Morris > wrote: > > On Jan 8, 2017, at 05:49 , Charles Jenkins > wrote: >> >> changing to CDouble didn’t help > > This is one of those cases where I regretted pressing

Re: AVSimplePlayer in Swift?

2017-01-07 Thread Charles Srstka
> On Jan 7, 2017, at 3:24 PM, Charles Jenkins wrote: > > I did try after you asked, and KVO may be working, but the video doesn’t > play. If I delete the KVO bindings from IB and change my code like this: > > var currentTime : Double = 0 { > didSet { >

Re: AVSimplePlayer in Swift?

2017-01-06 Thread Charles Srstka
> On Jan 6, 2017, at 9:32 PM, Charles Jenkins wrote: > > - If I imitate the ObjC version and try to do the bindings in IB, the > time slider’s maxValue and value bindings don’t work (won’t compile) > because duration and currentTime are not NSNumbers. They don’t have to

Re: What should we do if file-opening takes a long time?

2016-12-31 Thread Charles Srstka
> On Dec 31, 2016, at 7:35 PM, Graham Cox wrote: > > NSProgress is thread safe and might be useful for this. One thing to be careful about when using NSProgress with threads is not to bind directly to it from your UI elements, since the updates will come in on the same

Re: What should we do if file-opening takes a long time?

2016-12-31 Thread Charles Srstka
> On Dec 31, 2016, at 1:06 PM, Jens Alfke wrote: > >> On Dec 31, 2016, at 12:52 AM, Daryle Walker > > wrote: >> >> Let’s assume we’re using a NSDocument-based application. If we’re opening a >> big file, like a gigabyte or more,

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Charles Srstka
> On Dec 7, 2016, at 1:00 PM, Quincey Morris > wrote: > > On Dec 7, 2016, at 08:24 , Charles Jenkins > wrote: >> >> If anyone knows how to play music from the library at a low volume, without >> screwing up

Why aren't NSFilePromiseProviderDelegate methods being called?

2016-12-06 Thread Charles Srstka
Okay, so I decided to try to experiment with NSFilePromiseProvider, in order to replace some legacy code using old-fashioned drag-and-drop methods. However, for some reason, the drag-and-drop system seems to completely ignore my NSFilePromiseProviderDelegate methods, and calls the old-fashioned

Why aren't NSFilePromiseProviderDelegate methods being called?

2016-12-05 Thread Charles Srstka
Okay, so I decided to try to experiment with NSFilePromiseProvider, in order to replace some legacy code using old-fashioned drag-and-drop methods. Seems simple enough; just have the outline view delegate’s -outlineView:pasteboardWriterForItem: method return an NSFilePromiseProvider. However,

Re: Preserving knowledge of renamed/moved directory?

2016-11-28 Thread Charles Srstka
> On Nov 28, 2016, at 7:42 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Nov 28, 2016, at 17:30 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> This is currently broken in S

Re: Preserving knowledge of renamed/moved directory?

2016-11-28 Thread Charles Srstka
> On Nov 28, 2016, at 7:06 PM, Rick Mann wrote: > > Back in the days before URLs, I could have an FSRef to a directory, and no > matter where I moved that directory what I named it, the FSRef was still > valid, and I could still read/write to it. > > Now that everything

Re: How to ResolvingSymlinksInPath ?

2016-11-04 Thread Charles Srstka
> On Nov 3, 2016, at 10:39 PM, Ken Thomases wrote: > > On Nov 3, 2016, at 10:08 PM, Gerriet M. Denkmann > wrote: >> >> URLByResolvingAliasFileAtURL does almost the same, has no special behaviour >> with “/private”, and

Re: How to ResolvingSymlinksInPath ?

2016-11-04 Thread Charles Srstka
> On Nov 3, 2016, at 10:39 PM, Ken Thomases wrote: > > On Nov 3, 2016, at 10:08 PM, Gerriet M. Denkmann > wrote: >> >> URLByResolvingAliasFileAtURL does almost the same, has no special behaviour >> with “/private”, and

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/

2016-10-22 Thread Charles Srstka
> On Oct 22, 2016, at 2:42 PM, Jean Suisse wrote: > >> >> On 22 Oct 2016, at 21:24, Quincey Morris >> > > wrote: >> >> On Oct 22, 2016, at 11:42 , Jean Suisse >

Re: Stupid objective-c question

2016-09-22 Thread Charles Srstka
> On Sep 22, 2016, at 6:07 PM, Quincey Morris > wrote: > > But that’s because the KVO notification mechanism is a more ancient design > concept, where it likely seemed simple, adequate and flexible. I assume it > comes from NeXTStep days (late 80s or early

Re: How to Launch an App using the Bundle ID?

2016-09-20 Thread Charles Srstka
> On Sep 20, 2016, at 5:48 AM, Dave wrote: > > Hi All, > > > I’m using launchApplication method from Shared Workspace, however, it accept > an Application Name and all I have is the Bundle ID. How can I launch an App > using the Bundle ID? > > All the Best > Dave

Re: loadNibNamed deprecated, but newer version crashes

2016-09-18 Thread Charles Srstka
What’s the crash? Is it an exception? If so, what’s the description that gets posted to the console? Charles > On Sep 18, 2016, at 6:35 PM, Gabriel Zachmann wrote: > > I would like to replace this line of code: > [NSBundle loadNibNamed: @"ConfigureSheet" owner:

Re: referencing a Swift Dictionary from Objective-C

2016-09-10 Thread Charles Srstka
> On Sep 11, 2016, at 12:16 AM, Gavin Eadie wrote: > > I’m moving some code from Obj-C to Swift and, from time to time, I open a gap > I cannot see across. This is one, and I’d love some assistance. > > I converted a pile of utility Obj-C code that included a class method of

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
> On Aug 19, 2016, at 9:56 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: > >>> So for the foreseeable future, the >>> difference is that +array returns an autoreleased object, meaning that in >>> ARC code, +new is the better choice. >>

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
> On Aug 19, 2016, at 8:25 PM, Kyle Sluder <k...@ksluder.com> wrote: > > > > On Fri, Aug 19, 2016, at 06:08 PM, Charles Srstka wrote: >>> On Aug 19, 2016, at 3:46 PM, Quincey Morris >>> <quinceymor...@rivergatesoftware.com> wrote: >>>

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
> On Aug 19, 2016, at 3:46 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Aug 19, 2016, at 10:53 , Charles Srstka <cocoa...@charlessoft.com > <mailto:cocoa...@charlessoft.com>> wrote: >> >> [NSArray array] is a sy

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
> On Aug 16, 2016, at 9:42 AM, Alex Zavatone wrote: > > I sent this out this morning but it got eaten, so this is a resend. Sorry if > it gets to some of you twice. > > > > Yes, I know about literals, but I have a different question here. > > > Is this safe? > > I have seen

Re: NSTask Open Word File

2016-08-11 Thread Charles Srstka
> On Aug 11, 2016, at 5:20 PM, Gurkan Erdogdu wrote: > > Hi folks > In my Swift application, I try to open a Word file with Microsoft Word > application via NSTask. Here is the code: > let task = NSTask() > task.launchPath =

Re: Root URL and URLByDeletingLastPathComponent

2016-07-17 Thread Charles Srstka
> On Jul 17, 2016, at 5:30 AM, Mike Abdullah wrote: > > It might be a mishandling of the two sorts of rot URL. If you try feeding in > this URL manually: > > file://localhost/ > > and removing the last component, what do you end up with? import Foundation

Re: NSStream and Threads

2016-07-04 Thread Charles Srstka
> On Jul 4, 2016, at 1:34 AM, Gerriet M. Denkmann wrote: > > Well, seems like the main thread? There’s your problem. Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: NSStream and Threads

2016-07-03 Thread Charles Srstka
> On Jul 3, 2016, at 11:35 PM, Gerriet M. Denkmann wrote: > > When I get an NSStream I do: > > aStream.delegate = myStreamDelegate; > [ aStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode: > NSDefaultRunLoopMode]; > [ aStream open]; > > myStreamDelegate then

Re: How to pre-select a file in NSOpenPanel -- specifically, a .app bundle?

2016-06-24 Thread Charles Srstka
> On Jun 24, 2016, at 7:47 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jun 24, 2016, at 16:24 , Charles Srstka <cocoa...@charlessoft.com> wrote: >> >> How could this be a security threat, when a malicious program could just set &

Re: How to pre-select a file in NSOpenPanel -- specifically, a .app bundle?

2016-06-24 Thread Charles Srstka
> On Jun 24, 2016, at 6:24 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: > > Making it not work with app bundles doesn’t seem to introduce any loopholes > that aren’t there already. *Making it work ___ Cocoa-dev maili

Re: How to pre-select a file in NSOpenPanel -- specifically, a .app bundle?

2016-06-24 Thread Charles Srstka
> On Jun 24, 2016, at 3:54 PM, Quincey Morris > wrote: > > 1. [Security] Being able to select an arbitrary file programmatically might > lead to spearphishing exploits, where the user is tricked into opening a file > that is otherwise inaccessible from

Re: Properties: A question of style

2016-06-15 Thread Charles Srstka
> On Jun 14, 2016, at 8:42 PM, Steve Mills <sjmi...@mac.com> wrote: > >> On Jun 14, 2016, at 19:45, Charles Srstka <cocoa...@charlessoft.com >> <mailto:cocoa...@charlessoft.com>> wrote: >> >> if thisArray.empty { doSomething() } > > Th

Re: Properties: A question of style

2016-06-14 Thread Charles Srstka
> On Jun 14, 2016, at 6:48 PM, Graham Cox wrote: > > Hi all, > > Just a quick point for discussion. > > Suppose I have a read-only BOOL property. What’s better, to declare it as: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOL

Re: NSFileWrapper

2016-06-05 Thread Charles Srstka
> On Jun 5, 2016, at 1:27 AM, Graham Cox wrote: > > >> On 5 Jun 2016, at 8:02 AM, Daryle Walker wrote: >> >> You have to come up with a new extension. For instance, if you’re already >> using “.xyz” for you single-file format, you could use

Re: Very basic need, very difficult to achieve.

2016-05-06 Thread Charles Srstka
> On May 6, 2016, at 11:19 AM, Richard Charles <rcharles...@gmail.com> wrote: > > >> On May 5, 2016, at 10:33 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: >> >>> On May 5, 2016, at 9:39 PM, Richard Charles <rcharles...@gmail.com> wrote: &g

Re: Very basic need, very difficult to achieve.

2016-05-05 Thread Charles Srstka
>> http://www.realtech-vr.com/glview/ >> >> I could never get an app that uses OpenGL to work with a virtual machine. > > > >> On May 5, 2016, at 8:16 PM, Charles Srstka <cocoa...@charlessoft.com> wrote: >> >> Seems to run all right in VMWar

  1   2   3   4   5   6   7   8   9   >