Re: Cocoa framework or Object class to uncompress files

2022-10-24 Thread Quincey Morris via Cocoa-dev
No. There’s no solution there. The Archive framework makes uncompressing of raw data easy, including the compression format that’s normally used inside .zip files, but it doesn’t actually read .zip file format. The file format and the compression algorithm are, in effect, unrelated to each

Re: Building for 10.12

2022-03-20 Thread Quincey Morris via Cocoa-dev
(Resending because I forgot to cc the list) On Mar 20, 2022, at 08:09, Gabriel Zachmann via Cocoa-dev mailto:cocoa-dev@lists.apple.com>> wrote: > > Apparently, this caused it: > > Symbol not found: _AVAudioSessionInterruptionNotification > > Yes, I am using that function, and yes, it seems to

Re: Security scoped bookmarks example?

2020-03-04 Thread Quincey Morris via Cocoa-dev
On Mar 4, 2020, at 06:12 , Gabriel Zachmann via Cocoa-dev wrote: > >// load new image from disk >NSURL * url = [NSURL fileURLWithPath: [self absolutePathFor: filename_] > isDirectory: NO]; >// filename_ is one of the paths from the list of images under the user > selected

Re: Confusion about screen resolution

2020-02-23 Thread Quincey Morris via Cocoa-dev
On Feb 22, 2020, at 20:56 , Richard Charles wrote: > > I am just curious, have you actually seen a 3X backing store or is this just > a surmise? Well, I can never remember what I’ve actually seen, so I just threw it in there. :) It’s used on iOS, but maybe not Mac.

Re: Confusion about screen resolution

2020-02-22 Thread Quincey Morris via Cocoa-dev
On Feb 22, 2020, at 15:31 , Gabriel Zachmann via Cocoa-dev wrote: > > I was always under the impression that the backing store is 2x the size of > the display. > That should be then 2x( 2880 x 1800 ), i.e., 5760 x 3600 , shouldn't it? > > So, either the frameRect should be 2880x1800 or 5760

Re: Handling of paths through sandbox

2020-02-12 Thread Quincey Morris via Cocoa-dev
On Feb 12, 2020, at 08:56 , Gabriel Zachmann wrote: > > So rather than having the last part being chopped off (which is the important > part), > I would like to remove the beginning of the path, since that is unimportant. For partial paths, you can try converting the URLs to URLComponents,

Re: Handling of paths through sandbox

2020-02-11 Thread Quincey Morris via Cocoa-dev
On Feb 11, 2020, at 09:00 , Gabriel Zachmann via Cocoa-dev wrote: > > I have a question regarding the proper handling of paths under Catalina, > some of which go through the Container, some don't. > > More specifically, I get the Pictures folder using this line of code: > > dir_to_scan =

Re: Swift -> Obj-C: return __kindof Something

2019-11-11 Thread Quincey Morris via Cocoa-dev
There’s now a Swift equivalent (loosely): “some NSManagedObject”. It’s sometimes referred to as a “reverse generic”, or “opaque type” because it hides the actual type behind a larger class type or protocol. The evolution proposal is here, if you want all the gory details:

Re: Thoughts on Objective-C++

2019-11-11 Thread Quincey Morris via Cocoa-dev
On Nov 11, 2019, at 17:05 , Turtle Creek Software via Cocoa-dev wrote: > > I didn't mean to start a language war, because it's not about C++ vs > Objective-C or Swift. I’ve been staying out of this, because you’ve seemed impervious (in the last few weeks since this topic has been discussed)

Re: Preventing app from being restored or saving info in "Saved Application State"

2019-11-11 Thread Quincey Morris via Cocoa-dev
On Nov 10, 2019, at 17:39 , Lars C. Hassing via Cocoa-dev wrote: > > I believe data in "~/Library/Saved Application State" is being used for this, > how can I programmatically in app two tell that restoration is not useful ? > > I’ve tried myMainWindow.restorable = NO. The thing that’s

Re: Swift -> Obj-C: return __kindof Something

2019-11-11 Thread Quincey Morris via Cocoa-dev
> On Nov 11, 2019, at 15:07 , Steve Christensen via Cocoa-dev > wrote: > > Some existing Obj-C methods are of the form: > > + (nullable __kindof NSManagedObject) someFooThing; > > Right now I have > > class var someFooThing: NSManagedObject? AFAIK, “__kindof” only affects the

Re: Need for Swift

2019-10-15 Thread Quincey Morris via Cocoa-dev
OK, apologies in advance for toes trodden on or sensibilities offended, but it sounds like it’s time for my anti-optional-whining rant. :) The really important thing about using Swift is that you *have to* learn to change the way you think about dealing with nil values. It’s not quite

Re: NSScrollView showing part of view with white space above

2019-10-13 Thread Quincey Morris via Cocoa-dev
On Oct 13, 2019, at 06:30 , Aandi Inston via Cocoa-dev wrote: > > If the NSScrollView is scrolled upwards, the content in the window moves down > (as normal). What we now see is a large white space at the top of the > NSScrollView, and below that the same view portion we first saw. It sounds

Re: Views without any layout constraints may clip their content or overlap other views

2019-09-26 Thread Quincey Morris via Cocoa-dev
On Sep 26, 2019, at 10:55 , Laurent Daudelin wrote: > > I’m pretty much in the same situation. There seems to be something going on > behind the scene. I also observed that when I started adding constraints, I > would suddenly get many warnings and errors, some alluding to missing “y" >

Re: Questions regarding release

2019-09-25 Thread Quincey Morris via Cocoa-dev
On Sep 25, 2019, at 13:52 , Rob Petrovec via Cocoa-dev wrote: > >> Is the IOObjectRelease() right or wrong ? > I’m not entirely sure since I can’t find the docs for > IOServicePortFromCGDisplayID. Given that the code fragment shows it as a message being sent to “self”, this looks like

Re: Confusion about release mode in Xcode

2019-09-25 Thread Quincey Morris via Cocoa-dev
On Sep 25, 2019, at 14:44 , Gabriel Zachmann via Cocoa-dev wrote: > > I have tried to create a new scheme, then changed the Build Configuration to > "Release". > But in > Build Phases ⟶ Copy Files > it still says that the product is copied from ... build/Debug. > (The destination is

Re: Views without any layout constraints may clip their content or overlap other views

2019-09-23 Thread Quincey Morris via Cocoa-dev
> On Sep 23, 2019, at 13:58 , Laurent Daudelin via Cocoa-dev > wrote: > > OH?!? That’s why I can’t find it. And now that you mention Xcode 11, I > remember having to install the command line tools a couple of days ago. It > must have been automatically updated as it is my current setting in

Re: Moving cells in a UITableView

2019-05-17 Thread Quincey Morris
On May 17, 2019, at 14:09 , Carl Hoefs wrote: > > Is this a bug, or is it documented behavior? > > Without the following setting: > >self.tableView.autoresizingMask |= UIViewAutoresizingFlexibleWidth; > > a UITableView won't permit reordering of the table's cells. I think the problem is

Re: Moving cells in a UITableView

2019-05-16 Thread Quincey Morris
On May 16, 2019, at 14:29 , Carl Hoefs wrote: > > iOS 12.2 > > I want to allow the user of my iPhone app to finger-reorder the rows in a > UITableView. > > I set tableView.editing=YES, and I receive 2 callbacks for each row in the > table: > > (1) -tableView:editingStyleForRowAtIndexPath:

Re: NSTextField "Discard Change"

2019-04-28 Thread Quincey Morris
On Apr 27, 2019, at 10:26 , Richard Charles wrote: > > Contrary to the documentation NSTextField does not support the NSEditor > protocol. Well, I apologize for not researching my answer better when I answered before. However, be careful of what you assume from the documentation. NSTextField

Re: NSTextField "Discard Change"

2019-04-07 Thread Quincey Morris
On Apr 5, 2019, at 20:55 , Richard Charles wrote: > > Sending the text field an abortEditing message does not work. How can changes > to the text field be discarded? Caveat: I don’t know the answer to what you’re asking, but I suspect you may be asking the wrong question. First of all, what

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Quincey Morris
On Mar 28, 2019, at 15:58 , Peter Hudson wrote: > > @interface ImportTool NSEncoding> : NSObject You’re Doing It Wrong™. You mean: > @interface ImportTool : NSObject NSTableViewDelegate, NSEncoding> I don’t know what it means the way you wrote it. Something about lightweight generic

Re: Drawing boxes around each digit entered in UITextField (Number Pad)

2019-02-10 Thread Quincey Morris
On Feb 9, 2019, at 12:36 , Devarshi Kulshreshtha wrote: > > Am I missing any important property in X axis from the calculation due to > which I am unable to get properly aligned bounding box over each digit? Yes, you’re Doing It Wrong™. :) Glyphs are laid out along the line according to their

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Quincey Morris
Actually, I believe this should be: chdir(docsSandbox.fileSystemRepresentation) even though that’s often going to end up being the same C-string in both cases. > On Feb 5, 2019, at 12:29 , Carl Hoefs wrote: > > Yes, chdir(docsSandbox.UTF8String) works perfectly!

Re: Crash in terminate: on Mavericks

2019-01-21 Thread Quincey Morris
On Jan 21, 2019, at 09:39 , James Walker wrote: > > I used LLDB, and said > > env NSZombieEnabled=YES > > before starting the process. You should turn on zombies from the Diagnostics panel of your target’s scheme, or (as Ken suggested) use Instruments. > The backtrace doesn't show any of

Re: Quick sanity check for iOS AVAudioSession

2018-11-29 Thread Quincey Morris
That all looks correct to me. > On Nov 29, 2018, at 06:22 , Eric E. Dolecki wrote: > > Does this seem about right? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Xcode 10 and disable layer backed windows in Mojave

2018-10-25 Thread Quincey Morris
On Oct 25, 2018, at 05:31 , Georg Seifert wrote: > > When I build my app with Xcode 10, Mojave uses the new layer backed windows. I’m not sure what that means. I don’t recall anything new about windows or layer backing in Mojave (but I may have missed something, of course). > My view drawing

Re: touchesMoved value setting

2018-09-18 Thread Quincey Morris
On Sep 18, 2018, at 06:15 , Eric E. Dolecki wrote: > > Once the distance number gets high enough, I start to get tVal values of 2, > 3, 4, etc. I think my logic is messed up here. Yes, it’s messed up. Instead of this: >currentValue = currentValue ± tVal you need this: >currentValue =

Re: Bothersome "NSView-Encapsulated-Layout-Height" constraint?

2018-08-30 Thread Quincey Morris
On Aug 30, 2018, at 17:23 , Demitri Muna wrote: > > I tried to force this by adding two constraints, 2 pixels above and below the > image, then got this: > > 2018-08-30 14:55:36.807612-0400 Nightlight[78272:15775715] [Layout] Unable to > simultaneously satisfy constraints: > ( >" 16

Re: NSComboBox

2018-07-25 Thread Quincey Morris
On Jul 25, 2018, at 15:40 , Casey McDermott wrote: > > I forgot to mention that the lists may contain 10,000s of items. Maybe > 100,000s. > Typing to select from NSPopUpButton works OK for short lists. I just made a > test > popup with 300 items and it's already awkward. 10K would be

Re: Exception handling

2018-06-14 Thread Quincey Morris
On Jun 14, 2018, at 11:33 , Casey McDermott wrote: > > However, simply replacing the C++ throw with a Cocoa exception via > [NSException raise : errString format : errString]; seems to work great. > Apparently it unwinds the call stack and is swallowed in the run loop. Yes, but do be careful

Re: Exception handling

2018-06-13 Thread Quincey Morris
On Jun 13, 2018, at 19:22 , Casey McDermott wrote: > > Nearly always, the event loop is the best place to escape to. This is not how current thinking goes, unless you mean something different from what I think you’re saying. If you’re implementing sanity (“should not happen”) checks, then

Re: runModalSession handling

2018-04-05 Thread Quincey Morris
On Apr 5, 2018, at 15:27 , Tom Doan wrote: > > I checked and none of my stopModalWithCodes are being fired, so the result > code has to be coming off the system dialog. I did a kludge where I used 100 > and 101 for my own stop codes, and continued on 0 and 1, and that seemed

Re: Harmful Notification Post Rate

2018-03-30 Thread Quincey Morris
On Mar 30, 2018, at 12:22 , Richard Charles wrote: > > My custom view implements -[NSResponder mouseDragged:] but this has never > caused any problems. I don’t have much to suggest except “try stuff”. I’d try to see what happened if I commented out the “mouseDragged”

Re: Harmful Notification Post Rate

2018-03-29 Thread Quincey Morris
On Mar 29, 2018, at 21:00 , Richard Charles wrote: > > How can I figure out what notification is posting at a high rate? Not sure, but have you turned on “NSWindow.acceptsMouseMovedEvents” by any chance? ___ Cocoa-dev mailing

Re: CoreText: determine symbol's characteristics: diacritic/space/cluster/wordbreak/etc

2018-03-18 Thread Quincey Morris
On Mar 18, 2018, at 13:11 , Ernesto Monde wrote: > > I want to know same amount of information about the string/glyphs > being processed - it would be great to know how to extract it. You can get some of this information by comparing against CharacterSet (in Swift, or

Re: Using NSFetchedResultsController with many-to-many relationship

2018-03-10 Thread Quincey Morris
On Mar 10, 2018, at 13:06 , Steve Christensen wrote: > > Don't complicate your life by managing multiple NSFetchedResultsControllers. > Just create a single one that returns Club entities. The other valid approach, I think, is to “join” the two entities. That is, introduce a

Re: WatchKit Baby Apps

2018-02-28 Thread Quincey Morris
On Feb 28, 2018, at 11:36 , Charles Jenkins wrote: > > I wanted to develop my own timer and repetition counter Given that this doesn’t sound like it’s going to be a store app (with IP ownership consequences), I would suggest submitting that entire project as a radar, with a

Re: NSSecureCoding & NSAttributedString

2018-02-19 Thread Quincey Morris
On Feb 19, 2018, at 10:32 , Markus Spoettl wrote: > > for the exact purpose of replacing classes Well, it’s not a cuckoo’s egg attack if the secure decoder is looking for the replacement cuckoo class, I guess. What still worries me is that you substitute with a class

Re: NSSecureCoding & NSAttributedString

2018-02-19 Thread Quincey Morris
On Feb 19, 2018, at 01:42 , Markus Spoettl wrote: > > I'm not sure where the NSAccessibility… keys are defined https://developer.apple.com/documentation/foundation/nsattributedstringkey > I found a workaround for the problem for classes that are not

Re: NSSecureCoding & NSAttributedString

2018-02-18 Thread Quincey Morris
On Feb 18, 2018, at 14:27 , Markus Spoettl wrote: > > yet this works (don't know why) I did this in Swift (so I could use a playground): > print (NSTextTab.self.conforms (to: NSSecureCoding.self)) // true > print (NSTextList.self.conforms (to: NSSecureCoding.self)) //

Re: NSSecureCoding & NSAttributedString

2018-02-18 Thread Quincey Morris
On Feb 18, 2018, at 14:01 , Markus Spoettl wrote: > > Arrays are easy to enforce but dictionaries are really a weak spot. For > starters you can't define which classes are acceptable as keys and which as > values. What if you have collection classes as values, what

Re: NSSecureCoding & NSAttributedString

2018-02-18 Thread Quincey Morris
On Feb 18, 2018, at 10:30 , Markus Spoettl wrote: > > The decoder isn't terribly concerned with where the individual classes will > occur, just that they might. I was going to reply that it’s stupid that it behaves like this, but I guess it makes some sense after

Re: NSSecureCoding & NSAttributedString

2018-02-17 Thread Quincey Morris
On Feb 17, 2018, at 20:34 , Glenn L. Austin wrote: > > Or encode/decode them using Coding, then encode/decode the resulting encoded > attributed string data using SecureCoding. Markus already said that archives exist with normally-encoded attributed strings, so that

Re: NSSecureCoding & NSAttributedString

2018-02-16 Thread Quincey Morris
On Feb 16, 2018, at 15:58 , Alex Zavatone wrote: > > So, splitting the solution into separate archival and unarchiving into 2 > sections, where the unsupported classes are handled separately is the ugly > but required path to take? It’s hard to say in general, because having

Re: NSSecureCoding & NSAttributedString

2018-02-16 Thread Quincey Morris
On Feb 16, 2018, at 15:06 , Alex Zavatone wrote: > > do you think that this be a case when it’s best to encrypt the strings > yourself with an HMac256 method on the attributed strings? There’s no actual encryption in NSSecureCoding, it’s just about making sure that malicious

Re: NSSecureCoding & NSAttributedString

2018-02-16 Thread Quincey Morris
On Feb 16, 2018, at 14:13 , Markus Spoettl wrote: > > how can I go about decoding NSAttributedString I just tried in a playground, and the problem is in NSParagraphStyle, not NSAttributedString. It looks like it falls foul of the known secure coding issue about

Re: Checking if a string is valid JSON

2018-01-29 Thread Quincey Morris
On Jan 29, 2018, at 13:30 , Saagar Jha wrote: > > Uhh…JSONDecoder swallows all of JSONSerialization’s errors and wraps it into > its own > .

Re: Checking if a string is valid JSON

2018-01-29 Thread Quincey Morris
On Jan 29, 2018, at 12:42 , Eric E. Dolecki wrote: > > So this would do it? I would strongly recommend using JSONDecoder instead of JSONSerialization. The errors JSONDecoder throws are AFAIK more detailed than JSONSerialization, and will tell you the exact location in the

Re: Scroll views

2018-01-19 Thread Quincey Morris
Well, I can’t figure out if IB supports your scenario in Xcode 9.2. In part, IB has some bugs in displaying the correct set of constraints error messages. In some cases, it displays errors for the wrong view; in some cases, it displays out-of-date messages until you rebuild the project, or

Re: Scroll views

2018-01-19 Thread Quincey Morris
On Jan 19, 2018, at 12:36 , Jeremy Hughes wrote: > > If you add a scroll view in Interface Builder, that’s how it is set up for > you by Interface Builder. You don’t have to add an autoresizing mask or use > it to pin the document edges - because Apple has already

Re: Scroll views

2018-01-19 Thread Quincey Morris
On Jan 19, 2018, at 04:28 , Jeremy Hughes wrote: > > Summarising: it seems that to get a vertically scrolling view that works as > expected, the content view must be set to be flipped (no way of doing this in > IB) and the flexible-height arrow must be turned off.

Re: Deciphering an error message on an iOS UITextField subclass.

2018-01-17 Thread Quincey Morris
On Jan 17, 2018, at 17:58 , Alex Zavatone wrote: > > Cell does not have this problem and is the proper subclass. It properly > reports both its class and the expected result for if it is a kind of > UITableViewCell class. What the debugger is telling you is from run-time

Re: Deciphering an error message on an iOS UITextField subclass.

2018-01-17 Thread Quincey Morris
On Jan 17, 2018, at 17:24 , Alex Zavatone wrote: > > Am I right in assuming that Xcode thinks that the subclass has 2 possible > UITextField parent classes? Well, the error message about ambiguity is confusing enough that it’s worth a bug report (even if it’s only a minor

Re: Popup-Menu Binding issue in Cell-based NSTableView

2018-01-01 Thread Quincey Morris
On Jan 1, 2018, at 01:46 , Motti Shneor wrote: > > Selected Object bound to Measurements Array Controller, Controller Key: > arrangedObjects, Model Key Path: species, Allows Editing Multiple Values > Selection, Conditionally Sets Enabled, Creates Sort Descriptor Your

Re: Data, enumerateBytes: separate blocks?

2017-12-27 Thread Quincey Morris
On Dec 27, 2017, at 11:59 , Daryle Walker wrote: > >> guard let firstBreak = index(where: { >> [MyConstants.cr, MyConstants.lf].contains($0) >> }) else { return nil } I would be inclined to code it like this: > guard let firstBreak =

Re: Data, enumerateBytes: separate blocks?

2017-12-25 Thread Quincey Morris
On Dec 25, 2017, at 10:23 , Daryle Walker wrote: > > What happens if whichever byte value is second is gigabytes away from the > first? Your Data extension code doesn’t solve that problem anyway: > var firstCr, firstLf: Index? > enumerateBytes { buffer, start,

Re: NSDocument autosave in place – possible data loss?

2017-12-24 Thread Quincey Morris
On Dec 24, 2017, at 16:36 , Alan Snyder wrote: > > But suppose the document is autosaved between the cut and paste, and the app > or system crashes before the next autosave. > > Would the content then be lost, and would the user even know? 1. Without autosave,

Re: Data, enumerateBytes: separate blocks?

2017-12-24 Thread Quincey Morris
On Dec 24, 2017, at 04:45 , Charles Srstka wrote: > > you could consider making its interface take generic collections of UInt8 This would not solve the *general* problem Daryle raised. He’s looking for a way to test the logic of some buffer-boundary-crossing code,

Re: Data, enumerateBytes: separate blocks?

2017-12-24 Thread Quincey Morris
On Dec 23, 2017, at 23:03 , Daryle Walker wrote: > > The library doesn’t need DispatchData, just my test case (and only as posing > as a Data instance). You *could* try moving the logic that’s inside your current enumerateBytes closure to a new method, and just call the

Re: Data, enumerateBytes: separate blocks?

2017-12-22 Thread Quincey Morris
On Dec 22, 2017, at 08:48 , Daryle Walker wrote: > > DispatchData would need to be convertible to Data. Is there a way to do the > conversion in Swift? Actually, on consideration, I think not. It would be if DispatchData was bridgeable like Data, but it isn’t, and I don’t

Re: Data, enumerateBytes: separate blocks?

2017-12-21 Thread Quincey Morris
On Dec 21, 2017, at 18:04 , Daryle Walker wrote: > > when multiple blocks are used At this point, I don’t understand what you don’t understand. Here’s a code fragment that works in a playground: > import Foundation > > let buffer1: [UInt8] = [1,2] > let buffer2: [UInt8] =

Re: Creating NSTableView programmatically

2017-12-20 Thread Quincey Morris
On Dec 20, 2017, at 18:55 , Rob Petrovec wrote: > > Not for nothin', but I don’t think bindings have died. So, let me respond jointly to all of the comments similar to this. Of course bindings haven’t “died”, in the sense that no one *uses* them any more. My point was that

Re: Creating NSTableView programmatically

2017-12-20 Thread Quincey Morris
On Dec 20, 2017, at 01:23 , Eric Matecki wrote: > > The sole purpose of my project is to learn how bindings works, it has no > practical application per se. Bindings exist to support the use of NIB-based UI behavior. All bindings work the same way, in the sense that they

Re: Pasteboards and NSSecureCoding

2017-12-19 Thread Quincey Morris
On Dec 19, 2017, at 18:32 , Jeremy Hughes wrote: > >> On 20 Dec 2017, at 02:22, Jeremy Hughes > > wrote: >> >> What I don’t like about [NSArray.self] is that it’s an artefact of bridging. >> I’m not

Re: Pasteboards and NSSecureCoding

2017-12-19 Thread Quincey Morris
> On Dec 19, 2017, at 17:38 , Jeremy Hughes wrote: > > let array = decoder.decodeObject(of: [[Int].self], forKey: kArrayKey) as! > [Int] > > gives an error: > > Cannot invoke 'decodeObject' with an argument list of type '(of: > [[Int].Type], forKey: String)’

Re: Pasteboards and NSSecureCoding

2017-12-19 Thread Quincey Morris
On Dec 19, 2017, at 17:09 , Jeremy Hughes <moon.rab...@virginmedia.com> wrote: > > In a previous discussion, Quincey Morris wrote: > >> The solution is to fall back to an explicit NSSet object: >> >> let classes = NSSet (objects: NSArray.self, MyEleme

Re: Data, enumerateBytes: separate blocks?

2017-12-19 Thread Quincey Morris
On Dec 19, 2017, at 14:57 , Daryle Walker wrote: > > What are the hoops/bridges required? I think I was referring to what Wim Lewis said, which is that you can create DispatchData values (or perhaps dispatch_data_t objects), but you’re going to have to forcibly cast from

Re: Creating NSTableView programmatically

2017-12-19 Thread Quincey Morris
On Dec 19, 2017, at 02:24 , Eric Matecki wrote: > > When I select a row in a NSTableView, that selection doesn't "make it" all > the way to update the controller... I masochistically downloaded your project, and I think it’s a perfect example of why not to do this. There is

Re: Creating NSTableView programmatically

2017-12-12 Thread Quincey Morris
On Dec 12, 2017, at 02:12 , Eric Matecki wrote: > > In the case of NSTableCellView, neither binding works... I don't get any > exception or crash, but nothing is displayed inside my table view (although > it's size suggests the four rows are there). This was a conceptual

Re: Creating NSTableView programmatically

2017-12-11 Thread Quincey Morris
On Dec 11, 2017, at 10:19 , Alastair Houghton wrote: > > NSTableViewCell is the old way to do it, before view-based tables were the > norm In this case, I think “NSTableViewCell” is a typo in the documentation. In the following tables, it refers to the binding

Re: Data, enumerateBytes: separate blocks?

2017-11-28 Thread Quincey Morris
On Nov 28, 2017, at 11:32 , Wim Lewis wrote: > > The only documentation of this is in the 10.9 release notes That’s what I was thinking of — thanks for clarifying. I believe that there is one more little piece to this that’s more recent. Since (after that 10.9 change) the

Re: Data, enumerateBytes: separate blocks?

2017-11-27 Thread Quincey Morris
On Nov 27, 2017, at 22:36 , Daryle Walker wrote: > > Is there a way to make a (NS)Data that uses multiple contiguous blocks? You mean multiple *non-contiguous* blocks?? The only way I know of forcing Data to use multiple blocks is via DispatchData. (In recent OS versions,

Re: Getting immutable UIImage data pointer without copy?

2017-11-14 Thread Quincey Morris
On Nov 14, 2017, at 20:11 , Rick Mann wrote: > > The bigger question is around the copy. In general, the answer must be that a copy ought to be expected. That’s because a data provider is not required to have a data buffer, so there’s not necessarily any underlying data

Re: Getting immutable UIImage data pointer without copy?

2017-11-14 Thread Quincey Morris
(resent to the list) On Nov 14, 2017, at 18:36 , Rick Mann > wrote: > > Is there a way to get at the underlying raw image data for a given UIImage > (in an immutable buffer) in Swift? > > Does this end up making copies? (For bonus points,

Re: NSTimer not firing when computer is inactive for a while.

2017-11-14 Thread Quincey Morris
On Nov 14, 2017, at 16:57 , Quincey Morris <quinceymor...@rivergatesoftware.com> wrote: > > I would suggest you try setting the QoS to at least “utility”, perhaps even > “user initiated”. To clarify: *what* you set to a different QoS depends on the nature of the thin

Re: NSTimer not firing when computer is inactive for a while.

2017-11-14 Thread Quincey Morris
On Nov 14, 2017, at 16:43 , Nathan Day wrote: > > I have a background process that uses an NSTimer that is set to fire every > minute, but when the computer is inactive for a while it will stop firing My guess is that it’s not a problem with the timer, but with the quality

Re: unable to update UI on main thread in 10.13

2017-10-27 Thread Quincey Morris
On Oct 27, 2017, at 07:40 , sqwarqDev wrote: > > It seems to be when the superAttributedString is added that I get the > warnings. — Is that backtrace from the main thread? — The symptoms you describe might be explained if the text storage is holding on to a reference

Re: [ANN] Nursery Framework 1.0.1 (build with Xcode 9) released

2017-10-27 Thread Quincey Morris
I haven’t studied your code, but based on the information you gave earlier, here are some suggestions: Kidnapper: maybe “collector”, “reclaimer” Peephole: maybe “window”, “aperture” (opening), “frame”, “segment” Stalker: “seeker” or “scanner” Stalk: “seek” or “scan” Play Lot: not sure what this

Re: [ANN] Nursery Framework 1.0.1 (build with Xcode 9) released

2017-10-26 Thread Quincey Morris
Akifumi, Alex Zavatone is just one voice. Not everyone has the same opinion. I am *not* offended at calling a class “NUKidnapper”. If the English naming is a problem, then I suggest you name the classes in Japanese (romaji). TBH, I don’t see why English speakers must demand English names. Of

Re: Problem using NSTimer in privileged helper tool

2017-10-20 Thread Quincey Morris
On Oct 20, 2017, at 03:23 , Mark Allan wrote: > > That worked with the block-based NSTimer API but not the selector-based API. > I tried changing it to 'currentRunLoop' which got rid of the crash, but the > timer never fired. This is pure guesswork, but I suspect this

Re: Problem using NSTimer in privileged helper tool

2017-10-19 Thread Quincey Morris
On Oct 19, 2017, at 09:04 , Mark Allan wrote: > > Terminating app due to uncaught exception 'NSInvalidArgumentException', > reason: '*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects > that adopt NSSecureCoding (object is of class '__NSCFTimer').' It’s

Re: [NSButton state] must by used from the main thread

2017-09-26 Thread Quincey Morris
On Sep 26, 2017, at 08:19 , Jens Alfke wrote: > > You’re assuming it’s a synthesized getter, but there’s no reason it couldn’t > be a custom method that does arbitrary computation before returning the > value, and there’s no way to know whether that work is thread-safe or

Re: [NSButton state] must by used from the main thread

2017-09-26 Thread Quincey Morris
On Sep 26, 2017, at 01:16 , Tamas Nagy wrote: > > but “state” of the NSButton is a NSInteger property, so that should be safe > to read from a background thread, right? Not necessarily. If the setter is thread-unsafe, then it’s possible that the getter may retrieve

Re: Inserting a button into another application's toolbar

2017-09-18 Thread Quincey Morris
On Sep 18, 2017, at 14:35 , Nick wrote: > > adding/injecting a toolbar icon with a custom handler code into the main > window of the application Isn’t that a massive security violation? Assuming you could get an icon into the toolbar (NSToolbar), it would need an action

Re: Dealing with validModesForFontPanel signature change

2017-09-14 Thread Quincey Morris
On Sep 14, 2017, at 09:07 , David Catmull wrote: > > Are there any other options? It looks like an unintentional error in the 10.13 SDK. If you look at other “enforcement” types, such as Notification.Name, they’ve been given a backwards-compatible availability, since

Re: Why are some Core Graphics APIs "hidden" from Swift?

2017-08-30 Thread Quincey Morris
On Aug 30, 2017, at 14:04 , Rick Mann wrote: > > But the X, Y versions have a double underscore: > >CGContext.__addArc(x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat, > radius: CGFloat) > > Why is this? I believe the double-underscore prefix indicates an Obj-C

Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Quincey Morris
On Aug 30, 2017, at 06:18 , Jonathan Mitchell wrote: > > My documents have a lot of variable user cancellable activity that must run > prior to document closure regardless of whether the document is dirty or not. > My solution is to run a termination preflight that

Re: XCTest and window restoration

2017-08-25 Thread Quincey Morris
(resent because I forgot to copy the list) On Aug 24, 2017, at 17:30 , Samuel Williams > wrote: > > What am I doing wrong? Nothing wrong, AFAICT. There is a scheme run option for disabling state restoration. Maybe setting

Re: NSMutableParagraphStyle -paragraphSpacingBefore

2017-08-22 Thread Quincey Morris
On Aug 22, 2017, at 10:02 , Jonathan Mitchell wrote: > > I don’t seem to be having much luck getting NSMutableParagraphStyle > -paragraphSpacingBefore to render. To render where? I have never found a way of getting it to be honored at the *top* of a text container, only

Re: Question about Audio for iOS (SessionCategory?)

2017-08-18 Thread Quincey Morris
On Aug 18, 2017, at 10:47 , Eric E. Dolecki wrote: > > I would assume that the audio would come back up. And wouldn't think my app > would pause Apple Music when it starts up... Unless someone else jumps in with the answer, I’d say it’s TSI time!

Re: NSUserDefault controller bindings - observeValueForKeyPath called twice?

2017-08-18 Thread Quincey Morris
On Aug 18, 2017, at 02:23 , Nick wrote: > > The problem is that observeValueForKeyPath is being called twice every time > I move the slider or enter a new value in the edit. This may be an artifact of updating the “model” (i.e. UserDefaults”) via a binding, and you may

Re: Question about Audio for iOS (SessionCategory?)

2017-08-18 Thread Quincey Morris
On Aug 18, 2017, at 10:10 , Eric E. Dolecki wrote: > >try audioSession.setCategory(AVAudioSessionCategoryPlayback, with: > [.allowBluetooth, .mixWithOthers]) According to the documentation, AVAudioSessionCategoryPlayback will “interrupt” other audio that

Re: transition custom views

2017-08-10 Thread Quincey Morris
On Aug 10, 2017, at 11:38 , J.E. Schotsman wrote: > > No, it’s a xib-based app. I think it’s a bit harder, because with a storyboard you can use segues, and set them up in IB. With the proviso that I haven’t tried what I’m about to suggest, here’s how I understand what

Re: transition custom views

2017-08-10 Thread Quincey Morris
On Aug 10, 2017, at 08:36 , J.E. Schotsman wrote: > > I would like to use the transition(from:to:options:completionHandler:) > method of NSViewController but the tab view item's viewController property is > nil. Are you using a storyboard for the window?

Re: Is "-init" really needed?

2017-08-08 Thread Quincey Morris
I don’t have a problem with using “new” vs. alloc/init, but there are a couple of technical issues hiding behind this, though in current practice they make little difference. 1. NSObject has “new” with a standard meaning. That means you can use “new” on any subclass where it’s OK to use the

Re: Best practice with NSProgressIndicator

2017-07-28 Thread Quincey Morris
On Jul 28, 2017, at 14:16 , Mark Allan wrote: > > Reducing the frequency of NSXPC messages was a secondary goal to figuring out > how often the main app ought to be updating the UI. I’d be interested in knowing why you didn’t say that the other way round. Surely reducing

Re: Best practice with NSProgressIndicator

2017-07-28 Thread Quincey Morris
On Jul 28, 2017, at 08:57 , Mark Allan wrote: > > I have an app with a helper tool that performs some lengthy process in a loop > and reports progress to the user. It works out how many iterations of the > loop will be needed, sets the progressbar.maxValue, and then

Re: Who owns a child view controller?

2017-07-14 Thread Quincey Morris
On Jul 14, 2017, at 11:43 , Greg Parker wrote: > > it would be deallocated after the callee relinquishes ownership and before > the caller can retake ownership See? I tried to reason about retain counts, and got it wrong. :) ___

Re: document-scoped bookmark

2017-07-14 Thread Quincey Morris
On Jul 14, 2017, at 11:57 , J.E. Schotsman wrote: > > I want to create document-scoped security bookmarks. > However, there seems to be no API for this. Huh? It’s described here:

  1   2   3   4   5   6   7   8   9   10   >