Re: Data, enumerateBytes: separate blocks?

2017-12-27 Thread Daryle Walker
192 times! I’m guessing that’s once for each byte the code goes past, right? Between that and wondering how efficient the test is, I wonder if using something like [2] would be better. But I would test a megabyte at a time or something. Now I have to figure out h

Re: Data, enumerateBytes: separate blocks?

2017-12-25 Thread Daryle Walker
ue.) I would end up wasting the user’s time for a second result I’d never use. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Data, enumerateBytes: separate blocks?

2017-12-23 Thread Daryle Walker
> On Dec 22, 2017, at 2:18 PM, Quincey Morris > wrote: > > On Dec 22, 2017, at 08:48 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> DispatchData would need to be convertible to Data. Is there a way to do the >> conversion in Swift? > >

Re: Data, enumerateBytes: separate blocks?

2017-12-22 Thread Daryle Walker
> On Dec 21, 2017, at 11:10 PM, Quincey Morris > wrote: > > On Dec 21, 2017, at 18:04 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> when multiple blocks are used > > At this point, I don’t understand what you don’t understand. Here’s a code

Re: Data, enumerateBytes: separate blocks?

2017-12-21 Thread Daryle Walker
> On Dec 19, 2017, at 8:08 PM, Quincey Morris > wrote: > > On Dec 19, 2017, at 14:57 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> What are the hoops/bridges required? > > I think I was referring to what Wim Lewis said, which is that yo

Re: Data, enumerateBytes: separate blocks?

2017-12-19 Thread Daryle Walker
ain. > However, as you say, there’s a bridge involving some simple hoops available > if necessary. What are the hoops/bridges required? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (C

SASL

2017-12-01 Thread Daryle Walker
Is there a (user-accessible) SASL library on macOS (X)? No need to download one for a mail client idea if the system comes with one. Sent from my iPhone ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moder

Data, enumerateBytes: separate blocks?

2017-11-27 Thread Daryle Walker
Is there a way to make a (NS)Data that uses multiple contiguous blocks? Besides generating a multi-gig file and hoping, that is. I’m using enumerateBytes for efficiency and need to test sequences that cross sub-blocks. Sent from my iPhone ___ Cocoa-d

What are the closure parameters for the Swift version of "Data.enumerateBytes"?

2017-09-09 Thread Daryle Walker
the segment’s start and span. The second parameter used to represent which span of bytes within the total NSData object are modeled in the segment, now I guess it’s now the index within the Data object where the modeled segment starts. Is my guess correct? — Daryle Walker Mac, Internet, and Video G

Re: [webkit-dev] How to display new MIME types?

2017-07-29 Thread Daryle Walker
ilar behavior. For example, your > extension could add script that detects a link (or other reference) in HTML > to the content of interest, then routes it (either as downloaded data or the > resource URL) to your native code, which could then render it either in your > associated app

Re: [webkit-dev] How to display new MIME types?

2017-07-20 Thread Daryle Walker
. What kind of plug-in? One still using NPAPI? Some other format? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: [webkit-dev] How to display new MIME types?

2017-07-20 Thread Daryle Walker
[I originally had this on the WebKit development list first.] > On Jul 18, 2017, at 3:31 PM, Daryle Walker wrote: > > [I’m not sure this is the right forum.] > > If I want Safari for Mac to display a new MIME type, how do I do it? I know > there used to be an Apple-custom AP

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

2017-04-07 Thread Daryle Walker
> On Apr 7, 2017, at 4:43 PM, Quincey Morris > wrote: > > On Apr 7, 2017, at 07:24 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> Does anyone have any ideas how to do this a runtime? I need to intercept >> when a table cell is created so I can

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

2017-04-07 Thread Daryle Walker
> On Apr 5, 2017, at 5:19 PM, Daryle Walker wrote: > >> On Apr 5, 2017, at 5:08 PM, Daryle Walker wrote: >> >>> On Apr 5, 2017, at 12:19 PM, Charles Srstka >>> wrote: >>> >>> Actually, while NSTableCellView won’t bind to *most* things

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

2017-04-05 Thread Daryle Walker
> On Apr 5, 2017, at 5:08 PM, Daryle Walker wrote: > > >> On Apr 5, 2017, at 12:19 PM, Charles Srstka wrote: >> >> >> Actually, while NSTableCellView won’t bind to *most* things outside of the >> table view, there is an exception for the table’s d

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

2017-04-05 Thread Daryle Walker
ground until your Mac > runs out of swap space and you’re forced to do a hard reboot. Hooray for > Xcode! I am using a storyboard. And this hang upon XIB-compilation is what happens whenever I try font-binding. — Daryle Walker Mac, Internet, and V

Re: Is there a way to pluralize menu items?

2017-04-05 Thread Daryle Walker
> On Apr 5, 2017, at 9: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 a way to change the menu >>

Is there a way to pluralize menu items?

2017-04-04 Thread Daryle Walker
locales do more than singular vs. non-singular in English). Can that help here? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Auto-layout: how do I make the other side "win"?

2017-04-04 Thread Daryle Walker
> On Apr 3, 2017, at 1:52 PM, Quincey Morris > wrote: > > On Apr 3, 2017, at 08:57 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> When I select the window in the window controller’s scene in the storyboard, >> its content size is 800x450. I

Re: Auto-sized table cells, for macOS

2017-04-04 Thread Daryle Walker
> On Mar 18, 2017, at 3:21 AM, Quincey Morris > wrote: > > On Mar 17, 2017, at 23:18 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> The table isn’t using the new values, though. > > There’s no direct relationship linking the intrinsic size

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

2017-04-04 Thread Daryle Walker
compiler jamming. (I always cancel and take out the change.) — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: Auto-layout: how do I make the other side "win"?

2017-04-03 Thread Daryle Walker
> On Apr 1, 2017, at 5:00 PM, Quincey Morris > wrote: > > On Apr 1, 2017, at 12:07 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> I got a feeling that, since the interior of the window and the exterior of >> the view are probably bound, that

Auto-layout: how do I make the other side "win"?

2017-04-01 Thread Daryle Walker
that, since the interior of the window and the exterior of the view are probably bound, that the auto-layout system is choosing the view’s smaller size over the window’s bigger one. How do I reverse this? Or do I have to manually increase the size of all the interior views? — Daryle Walker Mac

Can't use +initialize, now what?

2017-03-29 Thread Daryle Walker
override the initialize class method, because Swift can't guarantee that the Objective-C method will be called. (28954946)” So, what is code that needs to be setup early supposed to do? Use the application delegate’s will-finish-launching method and hope it is early enough? — Daryle Walke

How to make a NSText​Find​Bar​Container client.

2017-03-28 Thread Daryle Walker
ame: > NSTitlebarAccessoryViewController in bundle (null). Is anyone from Apple and/or has privately made a NSTextFindBarContainer class capable of helping? As I said, there are no answers from WebSearch (i.e. others will be helped by me). Is there Apple sample code that covers this? — D

Where can I write in Undo/Redo action titles?

2017-03-27 Thread Daryle Walker
live with plain “Undo” and “Redo” for my actions? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Can't access by data via KVC during KVO

2017-03-27 Thread Daryle Walker
ld = newField as! RawHeaderField > newFieldRanges.append(contentsOf: [field.name, > field.body].map { NSMakeRange(0, ($0 as NSString).length) }) > } > textRanges.replaceSubrange(textRanges.startIndex ..< > bodyTextRangeIndex, with: newFieldRanges)

Re: How do I set a NSTextView's font in Interface Builder?

2017-03-27 Thread Daryle Walker
> On Mar 24, 2017, at 2:28 PM, Keary Suska wrote: > >> On Mar 24, 2017, at 10:33 AM, Jens Alfke wrote: >> >>> On Mar 23, 2017, at 6:35 PM, Daryle Walker wrote: >>> >>> I have the NSTextView selected in its storyboard scene. And I have the >&

Re: Is there a way to access other controller square's other icons programmatically?

2017-03-27 Thread Daryle Walker
> On Mar 24, 2017, at 3:49 PM, Quincey Morris > wrote: > > On Mar 24, 2017, at 11:11 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> I have a re-explaination, including a picture, at … > > I think I’m beginning to understand what you’re askin

Click-through

2017-03-25 Thread Daryle Walker
Is there any way to disable click through? On a toolbar control or otherwise. Through an Interface Builder setting or otherwise. Sent from my iPhone ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Official sidebar?

2017-03-25 Thread Daryle Walker
Testing out my app. Finally noticed the new "Show Tab Bar" View menu item. The menu also handles the tool bar, full screen, and a sidebar. Never noticed that last one before. What do I have to do in my storyboard and/or window controller to support that? (Of course, I don't need one right now.

Re: Is there a way to access other controller square's other icons programmatically?

2017-03-24 Thread Daryle Walker
I have a re-explaination, including a picture, at <http://stackoverflow.com/questions/43002809/how-do-i-access-the-top-level-objects-of-a-storyboard-scene-programmatically>. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com > On Mar 23, 2017, at 9:44 P

Is there a way to access other controller square's other icons programmatically?

2017-03-23 Thread Daryle Walker
icon strip besides the controller itself) I want to keep referencing the same object & array controllers already allocated when I build my tree of text blocks to support find. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT

How do I set a NSTextView's font in Interface Builder?

2017-03-23 Thread Daryle Walker
the text-view with the initial font (the application/user non-fixed-width font). Is there a way to change the text-view’s font in IB? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev

Handling Cocoa Bindings over a tree of View Controllers

2017-03-21 Thread Daryle Walker
A design for my third window iteration involves using several NSViewController subclasses in a UI tree. The current (i.e. second) version just has the root NSViewController and a bunch of NSView objects. There is a NSObjectController and a NSArrayController to bind the various view objects to my

Re: Of course I forgot some NSTextFinder questions

2017-03-21 Thread Daryle Walker
> On Mar 20, 2017, at 1:41 PM, Quincey Morris > wrote: > > On Mar 20, 2017, at 04:58 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >>> If all the strings were concatenated together would be the ‘x’ in "fox”. > >> Is there a off-by-

Of course I forgot some NSTextFinder questions

2017-03-20 Thread Daryle Walker
f ranges for the cells’ text and flag that matches shouldn’t straddle boundaries. But should my text for the second half (i.e. the text view) be included in that list (going Make-Range(first-half-length, second-half-length))? Or as a separate string for the text view’s find bar (going Make-Range(0, sec

NSTextFinder guide

2017-03-20 Thread Daryle Walker
e for this class (besides Apple’s class definition page)? Or is there a cool guide on a seasoned developer’s blog (or here)? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: Auto-sized table cells, for macOS

2017-03-17 Thread Daryle Walker
— Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com > On Mar 17, 2017, at 2:24 PM, Quincey Morris > wrote: > > On Mar 17, 2017, at 01:45 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> I made my first attempt after readin

Re: Calculating intrinsicContentSize for a NSTextField

2017-03-17 Thread Daryle Walker
ct? > > An alternative way of calculating the intrinsic content size would be to use: > > attributedStringValue.boundingRect(with: size, options: > .usesLineFragmentOrigin) > > but this fails to take account of cell insets. — Daryle Walker Mac, Internet, and Video Game Junkie dar

Re: NSTableView column sizes

2017-03-17 Thread Daryle Walker
t reasonable things with these combinations of options, without > having to resort to programmatic adjustment. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Auto-sized table cells, for macOS

2017-03-17 Thread Daryle Walker
> On Mar 14, 2017, at 11:33 PM, Quincey Morris > wrote: > > On Mar 14, 2017, at 18:26 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> You’d think that this would be a solved problem…. > > It sort of is. I think you can find a solution on stackov

NSTableView column sizes

2017-03-15 Thread Daryle Walker
follow the new proportions.) — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Auto-sized table cells, for macOS

2017-03-14 Thread Daryle Walker
solved problem…. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa

Re: Printing questions

2017-03-12 Thread Daryle Walker
Sent from my iPhone > On Mar 12, 2017, at 5:18 AM, Daryle Walker wrote: > > I hope it’s a nice first try, but I have some concerns. > > 1. I also added an “Export as PDF…” menu item, which uses the save-as-PDF > default action. I guess it calls my code

Document drafts

2017-03-12 Thread Daryle Walker
Some of the API for NSDocument is oriented around draft documents. What is a draft and how does it differ from a non-draft? How do I create/open a document in draft mode? I didn't see anything about it in the Document guide; were drafts supposed to be a New World Order like auto-saves or version

Printing questions

2017-03-12 Thread Daryle Walker
limit is past the page margins so I lose part of the text. How can I set the wrapping-mode/margins correctly. 3. Are there any other (subtle) problems with the text-view code, since I just took it from Stack Overflow? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT c

Printing in a Mac app with multiple philosophies

2017-03-11 Thread Daryle Walker
have an interface question: what should I name the whole-model and specific window’s sub-view print actions? Should they be totally separate menu items, or with one hidden behind the Option key? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com

Re: How do I use a NSTextBlock in an attributed string?

2017-03-10 Thread Daryle Walker
> On Mar 9, 2017, at 7:05 AM, Daryle Walker wrote: > >> >> On Mar 8, 2017, at 4:17 PM, Daryle Walker wrote: >> >> I tried: >> >>> // Set the paragraph formatting for the body... >>> let bodyAdvancement = bodyFont

Re: How do I use a NSTextBlock in an attributed string?

2017-03-09 Thread Daryle Walker
> On Mar 8, 2017, at 4:17 PM, Daryle Walker wrote: > > I tried: > >>// Set the paragraph formatting for the body... >>let bodyAdvancement = bodyFont.maximumAdvancement >>let bodyIndent = max(bodyAdvancement.width, &g

How do I use a NSTextBlock in an attributed string?

2017-03-08 Thread Daryle Walker
ingle string, and used a range to influence just the separator. This got the same result. I thought treating the separator and body in separate strings first wouldn’t infect the body with the text block, but it (illogically) does! How do I end the influence of a block? Put -1 entries in the text-

Re: My method causes DATA LOSS! (was: Can I use the restore/auto-save loading functions for imports?)

2017-03-06 Thread Daryle Walker
> On Mar 6, 2017, at 7:05 PM, Daryle Walker wrote: > > >> On Mar 6, 2017, at 4:58 PM, Daryle Walker wrote: >> >> The docs fo “NSDocumentController.reopenDocument(for: withContentsOf: >> display: completionHandler:)” mention it’s for app restore. It ultimate

My method causes DATA LOSS! (was: Can I use the restore/auto-save loading functions for imports?)

2017-03-06 Thread Daryle Walker
> On Mar 6, 2017, at 4:58 PM, Daryle Walker wrote: > > The docs fo “NSDocumentController.reopenDocument(for: withContentsOf: > display: completionHandler:)” mention it’s for app restore. It ultimately > calls “NSDocument.init(for: withContentsOf: ofType:)”, which mentio

Can I use the restore/auto-save loading functions for imports?

2017-03-06 Thread Daryle Walker
purposes? Or can I use them for general code, like an import-document function? They look perfect; they load in a file’s data to a new document, but leave the document’s file-identity anonymous afterwards. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com

Enforcing Editor vs. Viewer (was: Which way should my document class handle an older format?)

2017-03-05 Thread Daryle Walker
> On Mar 4, 2017, at 3:40 AM, Daryle Walker wrote: > > My document class reads in UTF-8 data for its internal format. The format has > an older version that is ASCII-based. Since the latter is a subset of the > former, my parser can handle both formats. Right now, I can’t writ

Overriding the automatic-save type

2017-03-05 Thread Daryle Walker
class, but I don’t see anything that would help. However, could I use “NSDocumentController.typeForContents(of:)” to fill in the original file’s type? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing

Which way should my document class handle an older format?

2017-03-04 Thread Daryle Walker
substitute for “Save As” since Lion), I get a can’t-be-saved error. I guess the second scenario seems to be what I want, but it still seems ugly. Are there any better solutions? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com

Re: I think I messed up the undo-count during load

2017-03-03 Thread Daryle Walker
Nearly a day later, and the bug doesn’t show up now. I hate Heisen-bugs. But is there a timing issue on how “NSManagedObjectContext.save” works? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list

I think I messed up the undo-count during load

2017-03-02 Thread Daryle Walker
let saveError { > self.initError = saveError > } > } > mainContext.automaticallyMergesChangesFromParent = true > mainContext.undoManager = self.undoManager Is “automaticallyMergesChangesFromParent” m

Re: UTI and/or bundle-IDs with small letters

2017-03-02 Thread Daryle Walker
> On Mar 2, 2017, at 2:38 PM, Daryle Walker wrote: > > I’m trying out my document-based Mac app’s data-read routine, and the code it > being skipped. I actually check the typeName (i.e. the UTI) and it doesn’t > match. My bundle identifier for the app has capital let

UTI and/or bundle-IDs with small letters

2017-03-02 Thread Daryle Walker
, I looked at the TextEdit sample code, and it uses the type conformance methods instead of an exact string match. Should I be doing that instead? (Although that means no more “switch” statement.) — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com

Search terms with NSDocument and Apple Events

2017-03-02 Thread Daryle Walker
, at least). — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev

Re: macOS 10.13 suggestion for init() throws

2017-03-01 Thread Daryle Walker
> On Feb 28, 2017, at 4:26 PM, Jens Alfke wrote: > > >> On Feb 28, 2017, at 11:56 AM, Daryle Walker > <mailto:dary...@mac.com>> wrote: >> >> The problem here is an interface mismatch where Swift has function >> throw-ability status out-of-ba

Re: Replacement of deprecated API GetProcessInformation

2017-02-28 Thread Daryle Walker
pp project in Xcode 7 and 8, the latter dropped the signature entry in the default-generated Info.plist file. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: macOS 10.13 suggestion for init() throws

2017-02-28 Thread Daryle Walker
> On Feb 28, 2017, at 12:27 PM, Jens Alfke wrote: > > >> On Feb 28, 2017, at 4:56 AM, Daryle Walker > <mailto:dary...@mac.com>> wrote: >> >> Could we have a NSDocument.init() that throws in the next macOS? That would >> translate to a "initWi

macOS 10.13 suggestion for init() throws

2017-02-28 Thread Daryle Walker
Could we have a NSDocument.init() that throws in the next macOS? That would translate to a "initWithError" in Objective C (I think). It would be the new primary initializer, with the current one calling it and dropping any error to oblivion. This doesn't make any difference to Objective-C subcl

Memory-mapped sub-data?

2017-02-26 Thread Daryle Walker
If I take a "subdata" of a memory-mapped (NS)Data, does it stay mapped (i.e. use a range and reference)? Or does a full copy get made? I'm thinking of making a parser be a sub-parser too, and this would make the difference between scanning the next megabyte or the rest-of-file (even if it's giga

Re: I think I screwed up Core Data multi-threading rules.

2017-02-25 Thread Daryle Walker
> On Feb 23, 2017, at 10:43 PM, Quincey Morris > wrote: > > On Feb 23, 2017, at 18:25 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >>>override func save(to url: URL, ofType typeName: String, for >>> saveOperation: NSSaveOpera

Re: I think I screwed up Core Data multi-threading rules.

2017-02-23 Thread Daryle Walker
> On Feb 23, 2017, at 1:56 AM, Daryle Walker wrote: > > I naively thought this was OK, multi-threading wise. It worked before I added > the “canAsynchronusly…” method to say TRUE for my main file type. When that > method is added, the save hangs the program. > >>o

I think I screwed up Core Data multi-threading rules.

2017-02-22 Thread Daryle Walker
s. Is the new persistent-container class not thread-safe even for returning (new) contexts? Am I calling “unblockUserInteraction” inappropriately? (I had that question in another post.) Is it the way I handle throwing? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com _

When to call unblockUserInteraction()

2017-02-22 Thread Daryle Walker
Although that method doesn't mention it, can I call it during data(ofType:), which is called by those other methods by default (I think)? Sent from my iPad ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mod

Typing into a NSTextView and overriding it

2017-02-20 Thread Daryle Walker
1. How can one type in control characters into a text-view? I mean ASCII range 0 through 31 and 127, not counting horizontal-tab and line-feed. 2. Is there a way to filter out the user from typing (or pasting, etc.) characters you don't want (like NUL)? 3. Is there a way to limit the length of a

Re: How hard is it to make a NSOrderedSetController?

2017-02-18 Thread Daryle Walker
> On Feb 19, 2017, at 2:30 AM, Daryle Walker wrote: > > There is one problem though. The button for “add:” works; it adds a new > entry. But the button for the “remove:” action only works once. Worse, it > only removes the last added row, no matter which row is selected! Anothe

Re: How hard is it to make a NSOrderedSetController?

2017-02-18 Thread Daryle Walker
> On Feb 18, 2017, at 7:06 PM, Keary Suska wrote: > > >> On Feb 18, 2017, at 4:44 PM, Daryle Walker wrote: >> >> I’m using a NSValueTransformer object to convert my Core Data to-many >> ordered relationship from a NSOrderedSet to a NSArray so NSArray

How hard is it to make a NSOrderedSetController?

2017-02-18 Thread Daryle Walker
it create entries for custom Binding-capable classes? If the answer is no customization, then I would have to connect the NSManagedObject instance to the controller in code. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com _

Re: A horizontal line rule within a NSAttributedString?

2017-02-18 Thread Daryle Walker
string from it, and > combine your three attributed strings into one. > -- > Gary L. Wade > http://www.garywade.com/ <http://www.garywade.com/> >> On Feb 18, 2017, at 2:16 PM, Daryle Walker > <mailto:dary...@mac.com>> wrote: >> >> An idea for

A horizontal line rule within a NSAttributedString?

2017-02-18 Thread Daryle Walker
). Poking around NSAttributedString, there seems to be a NSTextBlock that could do it. Any advice on how? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

NSArrayController still doesn't support NSOrderedSet? (was: Are instances of a NSManagedObject subclass usable as regular objects?)

2017-02-15 Thread Daryle Walker
> On Feb 14, 2017, at 6:50 PM, Daryle Walker wrote: > > Looking at my code again, I had a massive brain-fart. I created all the data > objects with local “let,” but forgot to assign the top-level object to my > document’s data property. > > Once I did that, the window d

Re: Throwing an error from a NSDocument.init override

2017-02-15 Thread Daryle Walker
> On Feb 14, 2017, at 1:24 PM, Quincey Morris > wrote: > > On Feb 14, 2017, at 00:26 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> But I can’t call the “super” versions of those other initializers from >> within my override. > > This i

Re: Are instances of a NSManagedObject subclass usable as regular objects?

2017-02-14 Thread Daryle Walker
aderField; > id: 0x60031140 > ; data: { > body = planet; > message = "0x60031300 > "; > name = Bye; > }) > )} of class _NSFaultingMutableOrderedSet This error came up twice on app start. It came up once more when I tried clicking on the app

Are instances of a NSManagedObject subclass usable as regular objects?

2017-02-14 Thread Daryle Walker
not enough to know what I’m actually doing.] — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Throwing an error from a NSDocument.init override

2017-02-14 Thread Daryle Walker
“init()”? I could just call “fatalError” or similar instead. (Oh, I got error objects because I’m initializing my (per-document) Core Data stack in “init()”.) — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev

Does the NSPersistentContainer name mean anything?

2017-02-12 Thread Daryle Walker
name still relevant? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Is it OK to use the default initializer of NSPersistentStoreDescription?

2017-02-12 Thread Daryle Walker
-memory store, which doesn’t need a URL (as far as I know). Is this an official way to start declaring a NSPersistentStoreDescription (for in-memory stores)? Or should I put in a junk URL in the publicized initializer then set the field to NIL? — Daryle Walker Mac, Internet, and Video Game

Re: Optionality in a NSManagedObject sub-class

2017-02-10 Thread Daryle Walker
> On Feb 10, 2017, at 3:02 AM, Daryle Walker wrote: > > It’s simple: > > - I’m writing this framework for an app, both macOS, with Swift 3 and Xcode 8. > - My protocol has two non-optional strings. > - I unchecked “Optional” for those attributes when editing the model fil

Optionality in a NSManagedObject sub-class

2017-02-10 Thread Daryle Walker
versions to non-optionals? What’s the risk/trade-offs if I do so? — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Merging scrolling/clipping with NSStackView

2017-01-21 Thread Daryle Walker
> On Jan 19, 2017, at 1:25 PM, Quincey Morris > wrote: > > On Jan 19, 2017, at 06:39 , Daryle Walker <mailto:dary...@mac.com>> wrote: >> >> The inner views should be as tall as they need to be. > > I don’t understand this part. How tall is that? >

Re: On NSIncrementalStore UUID Uniqueness

2017-01-19 Thread Daryle Walker
> On Jan 16, 2017, at 12:08 PM, Charles Srstka wrote: > >> On Jan 14, 2017, at 4:41 AM, Daryle Walker > <mailto:dary...@mac.com>> wrote: >> >> Could I base the UUID off a hash of the URL? Maybe, but it wouldn’t survive >> file moves. There are fil

Re: On NSIncrementalStore UUID Uniqueness

2017-01-19 Thread Daryle Walker
> On Jan 16, 2017, at 3:59 AM, Alastair Houghton > wrote: > > On 14 Jan 2017, at 10:41, 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 mo

Re: Purge all remnants of an old incarnation of my app

2017-01-19 Thread Daryle Walker
I posted this on the Xcode list, but one of the respondents suggested adding it here too…. > On Jan 15, 2017, at 8:11 PM, Daryle Walker wrote: > > I threw away an app I made in Xcode 7, including clearing its Git space and > replacing it with an empty branch. I created a new app

Merging scrolling/clipping with NSStackView

2017-01-19 Thread Daryle Walker
Right now, my window has a table view sitting on top of a text view. Those templates from Interface Builder have those NSViews surrounded by a clip view surrounded by a scroll view. But I want to flip that around; put the table and text views together in a stack view, and surround that with clip

Re: On NSIncrementalStore UUID Uniqueness

2017-01-15 Thread Daryle Walker
> On Jan 14, 2017, at 2:32 PM, Jens Alfke wrote: > > >> On Jan 14, 2017, at 2:41 AM, Daryle Walker > <mailto:dary...@mac.com>> wrote: >> >> I’m seemingly stuck since the data format doesn’t have a UUID field within >> it and I can’t base a

Re: On NSIncrementalStore UUID Uniqueness

2017-01-14 Thread Daryle Walker
read that there’s a bug in the URL class where it would degrade file-reference URLs to standard-file URLs, so that’ll be problematic. Another solution would to create bookmark data from a file URL and take a hash of that. But are multiple bookmark data blocks of the same file URL co

Re: Retaining non-document windows

2017-01-14 Thread Daryle Walker
on I had was how to remove the window (controller) reference. I think there’s an NSNotification whenever a window closes; do I have to use that (or the equivalent window delegate method) to flag when to remove the pointer from my collection object (or set the single

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

2017-01-14 Thread Daryle Walker
since it’s floating-point.) The “Progress” page has an “isOld” attribute that isn’t documented, also with some undocumented publish & subscribe API. Are those a mistake? Or an obsolete API (and we should use the documented members)? — Daryle

What do NSArrayController, etc. do for me?

2017-01-13 Thread Daryle Walker
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 classes give me? Sent from my iPhone _

Opposite of windowDidLoad

2017-01-12 Thread Daryle Walker
I was thinking of adding a Cocoa Binding during my window-controller's did-load method. But where would the unbinding go? I see waiting until deinit or implementing NSWindowDelegate and using windowWillClose. Is there a similar access point for view-controllers? Sent from my iPhone

Refreshing Cocoa Bindings

2017-01-11 Thread Daryle Walker
I'm going to store a reference to a model in a NSViewController's representedObject field. The various contained views will reference that field through KVO (Is that possible?) for their bound values. If I change the value of the represented object (what it points to, not any attributes within),

On NSPersistentStore Modeling

2017-01-10 Thread Daryle Walker
I read about store coordinators and managed contexts using Core Data models (I.e. "momd" files). But persistent store subclasses use them too right? From looking at the docs for the atomic and incremental stores, their internal scheme have to match a specific model too; they can't support generi

On NSIncrementalStore UUID Uniqueness

2017-01-10 Thread Daryle Walker
Been reading up on NSIncrementalStore, including its guide. I think I grok it more now. When initializing an instance, you're supposed to submit an UUID. Can a single value be used for all instances, or is it supposed to unique per instance? If the latter, and the source data doesn't already ha

  1   2   3   >