Re: Is NSTreeController good with Cocoa Bindings and Core Data now?

2015-08-24 Thread Jerry Krinock
> On 2015 Aug 23, at 17:50, Dave Fernandes wrote: > > It’s been working pretty well since Snow Leopard. Haven’t had any weird undo > issues in a while. Thank you, Dave. With the votes thus counted as 1 YAY and 0 NAY, I’ll give it a try :) ___ Coc

Re: Auto-Layout Again

2015-08-27 Thread Jerry Krinock
In a hurry here, but, I know Auto Layout does not always play well with scroll views. ___ 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-admins

Re: Basics of Cocoa Bindings

2015-09-08 Thread Jerry Krinock
> On 2015 Sep 08, at 21:04, Alex Hall wrote: > > why are keyPathsForValuesAffecting needed? Is this method taking the > place of something I might do in IB, or is this something different? Of course, they are not required, as many successful apps were written before we had Cocoa Bindings. On

Display USB Video Camera output : AVFoundation?

2015-09-09 Thread Jerry Krinock
In a Mac app, I need to display real-time video (as in “movies”) from a USB camera on the screen. Can someone please confirm that AVFoundation the way to go? I’ve read that QTKit is deprecated but, oddly, I cannot find any mention of deprecation here in the QTKit Programming Guide: https://de

Re: Display USB Video Camera output : AVFoundation?

2015-09-10 Thread Jerry Krinock
> On 2015 Sep 10, at 07:50, Gordon Apple wrote: > > Second, you can use AVCaptureView or AVCaptureVideoPreviewLayer. Holy cow. I just instantiated an AVCaptureView in InterfaceBuilder, added AVKit.framework to the project, build, run and what to my wondering eyes did appear but my ugly face,

Re: Display USB Video Camera output : AVFoundation?

2015-09-12 Thread Jerry Krinock
Well, AVCaptureView is not very malleable. I needed to use an AVCaptureVideoPreviewLayer, which needed quite a few more lines of code than the zero I reported yesterday :( For the record, I have pasted in the working code below. The only problem is that this silly warning prints to the consol

NSSplitViewController : not in Interface Builder library?

2015-09-15 Thread Jerry Krinock
NSSplitViewController was introduced in 10.10. I’ve read some posts which imply that there should be such a thing, with associated NSSplitViewItem objects, in the Object Library in Interface Builder. And it seems like they certainly should be in there. But for the life of me I cannot find any

Re: NSSplitViewController : not in Interface Builder library?

2015-09-16 Thread Jerry Krinock
Thank y’all for the replies. The omission is in both Xcode 6.4 and 7.1. The answer is: > On 2015 Sep 15, at 23:26, dangerwillrobinsondan...@gmail.com wrote: > > those are only available in storyboards in IB. I got the opposite impression from here: http://asciiwwdc.com/2014/sessions/411 wh

OpenGL Vertical Syncing effect on run loops

2015-09-22 Thread Jerry Krinock
In Apple document QA1385, in Listing 2, describing how to drive OpenGL Rendering Loops 10 years ago, an NSTimer, repeating every 1 millisecond, is added to an app’s run loop [1]. Referring to this timer, the text says that: "When vertical synchronization is enabled in your OpenGL application, d

Re: OpenGL Vertical Syncing effect on run loops

2015-09-26 Thread Jerry Krinock
On 2015 Sep 22, at 19:51, Greg Parker wrote: > But at some point the timer callback will provoke an OpenGL buffer swap, and > that will block until the next retrace when vertical synchronization is > enabled. The gated buffer swap inside the timer callback is the rate-limiting > factor, not a

-[NSThread start] blocks ?!?

2015-09-26 Thread Jerry Krinock
In a OS X app, predating Grand Central Dispatch, in the main thread, I create and start a new thread NSThread* worker ; worker = [[NSThread alloc] initWithTarget:instance selector:@selector(beginWithInfo:) object:info] ; [worker

Re: -[NSThread start] blocks ?!?

2015-09-26 Thread Jerry Krinock
> On 2015 Sep 26, at 15:53, Quincey Morris > wrote: > > On Sep 26, 2015, at 15:33 , Jerry Krinock wrote: >> >> Should not -[NSThread start] always return before running any of my code in >> the new thread? > > You have absolutely no control ov

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jerry Krinock
> On 2015 Sep 26, at 18:03, Quincey Morris > wrote: > > I don’t understand what you’re asking. I mean that if it is possible for -[NSThread start] to block indefinitely, it is not a useable API. I clicked the “Pause” and “Continue” multiple times in Xcode, but each time, in the main thread,

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jerry Krinock
On 2015 Sep 27, at 17:01, John Daniel wrote: > There is no way to tell what is causing the deadlock without knowing exactly > what is happening relating to: > 1) instance > 2) beginWithInfo: > 3) info Thank you, John. You are referring to what my secondary thread is doing. My point is that

Re: NSSplitViewController : not in Interface Builder library?

2015-10-07 Thread Jerry Krinock
> On 2015 Sep 16, at 08:48, Bill Cheeseman wrote: > > I recently spent two weeks trying to get NSSplitViewController to work > programmatically in an application with nibs, without success. I got close, > and I concluded that it probably can be done, but I gave up because it was > taking too

Re: Data not retained in document based core data app with cocoa bindings

2015-10-10 Thread Jerry Krinock
Hello, Devarshi. I think that adding the Document to your storyboard was a mistake. To prove that, log self to console in Document's init function, and you will see that, when one document opens, *two* Document objects get created. Your user interface is bound to one, and the persistent store

Re: Data not retained in document based core data app with cocoa bindings

2015-10-12 Thread Jerry Krinock
> On 2015 Oct 11, at 09:30, Richard Charles wrote: > >> On Oct 11, 2015, at 2:41 AM, Devarshi Kulshreshtha >> wrote: >> >> Looking for more clues :-| Devarshi, I tried the kludge which Richard found on Stack Overflow (self.view.window.windowController.document.managedObjectContext), and it

Re: -[NSThread start] blocks ?!?

2015-10-17 Thread Jerry Krinock
> On 2015 Sep 28, at 13:10, Greg Parker wrote: > > The threads listed are all waiting for a spinlock used by the debugging > tools. (Specifically, it's the machinery that records stack traces of queue > operations.) > > If you see this again, please capture a spindump and file a bug report. >

Re: Best Advice for accessing App Delegate's Managed Object Context

2015-10-18 Thread Jerry Krinock
> On 2015 Oct 18, at 05:05, Michael de Haan  wrote: > > I am using a separate, second “standAlone" Window to display a > SplitViewController. Design is StoryBoard, for an OS X application. > From appDelegate, I instantiate the SplitViewController in > “applicationDidFinishLaunching" > > let

Re: Best Advice for accessing App Delegate's Managed Object Context

2015-10-18 Thread Jerry Krinock
On 2015 Oct 18, at 12:18, Michael de Haan  wrote: > I have not worked that much with SplitViewControllers, The fact that it is a split view controller is not relevant here. You’d have the same issue with any kind of controller. > The immediate hurdle was to supply each “child” controller of

Re: Best Advice for accessing App Delegate's Managed Object Context

2015-10-19 Thread Jerry Krinock
> On 2015 Oct 18, at 13:07, Michael de Haan  wrote: > > I got rid of all the notification code, and substituted this in each > controller that needed access to the managedObjectContect > >> Just show me how to do that in Swift :) > > lazy var managedObjectContext:NSManagedObjectContext! …

Re: NSUserDefaults Bindings Reset

2015-11-03 Thread Jerry Krinock
> On 2015 Nov 01, at 04:58, Michael de Haan  wrote: > > NSUserDefaults.standardUserDefaults().removePersistentDomainForName(bundleIdentifier!) That line of code seems like it is pulling the rug out from under Cocoa Bindings, which might explain why they don’t work. A better way to reset to d

Re: Issue with NSTokenFieldCell in NSTableView and bindings..

2015-11-13 Thread Jerry Krinock
> On 2015 Nov 11, at 19:36, Samuel Williams > wrote: > > I'm trying to do something which in theory is rather simple: Use a > NSTokenFieldCell in a NSTableView and bind the table column value to the > token field. > > 1/ The binding doesn't seem to propagate the value back to the model. Known

Re: dateFromString won't accept this string:

2015-11-22 Thread Jerry Krinock
> On 2015 Nov 22, at 13:12, Alex Hall wrote: > > Is there something else I have to do, like tell the formatter what order to > expect components to be in? Yes, and more. You must set the dateFormat property of your date formatter exactly. Documentation of property ‘dateFormat’ refers you to

Re: dateFromString won't accept this string:

2015-11-22 Thread Jerry Krinock
> On 2015 Nov 22, at 21:12, Alex Hall wrote: > I'd still be curious to know about templates, but this works so I won't > spend time on it right now. The answer, with an example of why you might want to use templates, is explained in Data Formatting Programming Guide > Date Formatters > Custo

-[NSWindow parentWindow] for sheet never works?

2015-11-24 Thread Jerry Krinock
I’m updating an old project which used the -[NSApp beginSheet:] methods to use -[NSWindow beginSheet:completionHandler:]. In so doing, I now need the parent window in my action methods, so I can send the -[NSWindow endSheet::] message which runs the completion handler. In many cases, the s

Re: -[NSWindow parentWindow] for sheet never works?

2015-11-24 Thread Jerry Krinock
> On 2015 Nov 24, at 09:46, Quincey Morris > wrote: > > wrong property … The parent window in relation to *sheets* is “sheetParent”. Yes. Thank you. Another “bingo” for Quincey :) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: -[NSWindow endSheet?], was parentWindow

2015-11-24 Thread Jerry Krinock
> On 2015 Nov 24, at 14:54, Graham Cox wrote: > > You don’t send the parent window endSheet to run the completion handler - you > close the sheet itself by sending -endSheet to the SHEET, not its parent. Graham, I cannot find such a method, endSheet with no colon. > If you need to communicate

Re: -[NSWindow parentWindow] for sheet never works?

2015-11-26 Thread Jerry Krinock
> On 2015 Nov 25, at 02:49, Graham Cox wrote: > > I looked at the docs, saw [NSWindow -endSheet:sheetWindow] and totally > misinterpreted it. I might be losing my mind, this sort of thing seems to be > happening a lot lately. Your mind is fine – you’ve just been using Cocoa for so long that y

Non-deprecated way to determine Process Type (LSUIElement etc.) ?

2015-11-26 Thread Jerry Krinock
Several years ago I succumbed to a few users who wanted the ability to switch my OS X apps between foreground (regular app) and background (LSUIElement) on the fly. Switching has been possible in both directions since OS X 10.7, using TransformProcessType(). The user interface is, for example,

Re: Non-deprecated way to determine Process Type (LSUIElement etc.) ?

2015-11-26 Thread Jerry Krinock
> On 2015 Nov 26, at 23:08, Ken Heglund wrote: > > NSRunningApplication.activationPolicy might do the trick for you. Yes, just tested and it works. Bonus: Looks like setActivationPolicy should replace TransformProcessType(), and it even comes with KVO support :) Thank you, Ken. ___

Re: Non-deprecated way to determine Process Type (LSUIElement etc.) ?

2015-11-27 Thread Jerry Krinock
> On 2015 Nov 26, at 23:33, Ken Thomases wrote: > > Don't use NSRunningApplication when NSApplication will do. Oh, thank you Ken – that’s even better. NSApplication has the same ‘activationPolicy’ property. > The replacement for TransformProcessType() is -[NSApplication > setActivationPolic

NSWindow

2015-11-30 Thread Jerry Krinock
Apple has made a huge change in the way windows are drawn in El Capitan, which I cannot find mentioned in the Release Notes. Here are some examples: 1. Create a NSWindow, send it a -display message, and then in that same run loop cycle execute some task of noticeable duration. In 10.10, the w

Re: NSWindow displaying asynchronously starting in 10.11

2015-11-30 Thread Jerry Krinock
> On 2015 Nov 30, at 14:35, Quincey Morris > wrote: > > I’m not aware that the APIs you mention in 1 and 2 have any known contract > about when they have their effect. It could be synchronous or asynchronous, > and it could be now or later. You are correct. But after 20 years, seems like a

Re: NSDocument and NSViewControllers

2015-12-05 Thread Jerry Krinock
> On 2015 Dec 04, at 16:32, Rick Mann wrote: > > I have an NSViewController subclass and SCNView subclass. I can get at the > document from the NSViewController subclass via a rather cumbersome "let doc > = self.view.window?.windowController?.document as? ModelDocument” I just happened to hav

Re: Non-Resizable Window and Autolayout

2015-12-08 Thread Jerry Krinock
> On 2015 Dec 08, at 06:31, Dave wrote: > > I then select the Window in IB and select “Reset to Suggested Constraints”. also known as the “Ruin My Day” selection. > Does anyone have an idea why this is happening? It would be interesting to look at the window’s styleMask in the debugger and

Re: Translating offset from crash dump

2015-12-19 Thread Jerry Krinock
> On 2015 Dec 19, at 08:05, Aandi Inston wrote: > Anyway, what would you do with a crash dump routine + offset, not > reproducible? Aandi, I would step back and consider that I am over-thinking the problem. I would look at the information I have, which should be my function in which the crash

Re: Panes vs. Separate Windows

2016-01-09 Thread Jerry Krinock
> On 2016 Jan 09, at 14:19, Rick Mann wrote: > > Thoughts? You could argue this both ways until the cows come home, but here is one thought: I think the recent move toward one big window, like the move toward full-screen apps, has been advanced by the increased prevalance of laptops, with th

Re: Starting out with storyboards (on Mac)

2016-03-01 Thread Jerry Krinock
> On 2016 Mar 01, at 01:33, Daryle Walker wrote: > > Tried out Mac programming … turned on … storyboards. If: • Your primary experience is in OS X> • You know nibs. • Your purpose is to ship OS X apps, not broaden your horizons. Is there any reason to learn and use storyboards?

Re: Starting out with storyboards (on Mac)

2016-03-01 Thread Jerry Krinock
> On 2016 Mar 01, at 10:06, Quincey Morris > wrote: > > open TextEdit, open the storyboard, and choose File -> Revert To Saved -> > Browse All Versions… Very cool. I never realized that the Versions Browser would work across the edge case of document types (a text file, in this case) which

Re: Does NSOutlineView's highlightedTableColumn work?

2016-04-05 Thread Jerry Krinock
In an app I was working on, I also wanted the whole column to be highlighted. Here are comments from the code indicating how I did it. Some of these ideas might help: We want the selected column to be highlighted, for purposes of deleting columns. NSTableView does not provide this. When yo

Re: How to turn of the Journal logging of CoreData/Sqlite?

2016-04-06 Thread Jerry Krinock
> On 2016 Apr 06, at 08:27, Jens Alfke wrote: > > If you’re seeing high memory utilization, it’s more likely something to do > with Core Data itself. It might be a symptom of a way you’re misusing Core > Data I agree, having had an experience like James’ last year. It is a huge project; the

Re: [NSWorkspace openURL:] - any way to avoid a new tab?

2016-04-09 Thread Jerry Krinock
> On 2016 Apr 07, at 08:14, Jens Alfke wrote: > > If you send an AppleEvent directly to Safari, there might be a param to > control tab behavior. Oh, you could probably do that with AppleScript. Something like set myTab to make new tab set URL of myTab to http://whatever —- la

Re: Using a Core Data model by itself

2016-04-28 Thread Jerry Krinock
> On 2016 Apr 28, at 13:23, Jens Alfke wrote: > > So you can start out declaring the model classes like > @interface Message : NSObject Just to clarify, the reason why you must do this and not inherit from NSManagedObject is because the designated initializer of NSManagedObject is -ini

Re: Core Data user-defined fields

2016-05-02 Thread Jerry Krinock
In a similar situation, I defined one Property to represent both your Required (A, B, C) and User-defined properties, and wrote some business logic to ensure that the Required properties were always present. A variation would be that this user-interfacing Property is a dependent property, conne

Bind NSTableView to array of dictionaries in user defaults

2016-05-05 Thread Jerry Krinock
In an OS X app, I wanted to bind a table of objects, each represented by a dictionary, to an array of dictionaries in user defaults. So I bound the Content Array of the array controller to the 'values' of the shared user defaults controller with an arbitrary key path, which pleasantly became th

Re: Bind NSTableView to array of dictionaries in user defaults

2016-05-05 Thread Jerry Krinock
Thank you, Keary. > On 2016 May 05, at 13:47, Keary Suska wrote: > > >> On May 5, 2016, at 7:44 AM, Jerry Krinock wrote: >> >> So I bound the Content Array of the array controller to the 'values' of the >> shared user defaults controller w

Re: Bind View-Based NSTableView to array of dictionaries in user defaults

2016-05-06 Thread Jerry Krinock
> On 2016 May 06, at 07:58, Keary Suska wrote: > If you substitute with a cell-based table, it works flawlessly. > I was able to get it to work properly by proxy-ing the array in the app > delegate Keary, thank you very much for taking the time to test my demo project, and digging in to disco

Re: XCode snapshot function?

2016-05-09 Thread Jerry Krinock
> On 2016 May 09, at 18:48, Graham Cox wrote: > > So what’s the best way to mothball and archive my project in its current > state so I can then fork it for the next version, and so on? Either make a git branch, or if you don’t trust git, copy project folder(s). Projects that involve multiple

Re: XCode snapshot function?

2016-05-09 Thread Jerry Krinock
D > On 2016 May 09, at 18:48, Graham Cox wrote: > > So what’s the best way to mothball and archive my project in its current > state so I can then fork it for the next version, and so on? Either make a git branch, or if you don’t trust git, copy project folder(s). Projects that involve multipl

Re: Application Activation Problem

2016-05-16 Thread Jerry Krinock
Dave, I’ve tried to do stuff similar to this with NSWorkspace, and found it to be often frustrating. According to your initial post, you’ve already tried pretty hard. If lengthening the time delay still does not work good enough for you, then, • If the apps that you want to cycle through are

Re: Opening a file but not associating with NSDocument

2016-05-19 Thread Jerry Krinock
> On 2016 May 19, at 16:13, Rick Mann wrote: > > I have a complex NSDocument with lots of files. One of those files is has a > .mfst extension. If the user double-clicks one of those files, I want my app > to create my NSDocument subclass, and then call a method on it to read the > contents o

Re: Opening a file but not associating with NSDocument

2016-05-20 Thread Jerry Krinock
> On 2016 May 19, at 23:40, Rick Mann wrote: > > By "Reader," do you mean "Viewer?" I see no "Reader" option. Yes, I remembered the wrong word. English is so redundant. :) > Also, what do you mean "have no windows?" I just don't create anything in > -makeWindowControllers? Correct. > I'm c

Re: NSSplitViewController contents are shifted at first

2016-05-20 Thread Jerry Krinock
> On 2016 May 20, at 00:00, Rick Mann wrote: > > I have a Storyboard using autolayout constraints. I have an > NSWindowController with an NSSplitViewController as its content view > controller. That has two sub controllers. The left one has an NSOutlineView > that has top,left,right, and bott

Re: NSSplitViewController contents are shifted at first

2016-05-21 Thread Jerry Krinock
> On 2016 May 20, at 16:24, Rick Mann wrote: > > How do I set that? IB doesn't let me adjust the position of the split, Yes, it does if you’re persistent. I just tried it. Like many things in IB, you need to click on that divider several times, and if it doesn’t work, back out by clicking o

Re: NSSplitViewController contents are shifted at first

2016-05-22 Thread Jerry Krinock
> On 2016 May 22, at 02:25, Bill Cheeseman wrote: > I am using NSplitViewController in a Mac application with a storyboard, and I > think it's working well. I had tried it with a nib-based version of my > application first, without success despite a lot of time put into it. Yes, we noted a fe

Re: NSTreeController selection and Swift

2016-05-24 Thread Jerry Krinock
This may not work even if you work through the Swift issues. In Objective-C, the selection, selection indexes, and selected objects are all *not* observeable as documented in NSArrayController. See Apple Bug 7827354, closed as duplicate of 3404770. Assuming that NSTreeController is somehow b

Re: Is windowControllerDidLoadNib used only when windowNibName is?

2016-06-10 Thread Jerry Krinock
> On 2016 Jun 10, at 06:16, Daryle Walker wrote: > > I replaced windowNibName with makeWindowControllers since I'm moving window > management to a separate controller. I kept windowControllerDidLoadNib > around. Now I wondered if it still gets called. I put in a "print( #function > + "got cal

Re: How do I get data out of NSRuleEditor?

2016-06-26 Thread Jerry Krinock
> On 2016 Jun 26, at 12:29, Jim Thomason wrote: > > I've been desperately trying to use NSRuleEditor for a while now, since it > presents exactly the type of interface I want to show to the users. NSRuleEditor and NSPredicateEditor give you a quite a boatload, but as you’ve discovered they are

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Jerry Krinock
> On 2016 Jun 28, at 13:16, Jim Adams wrote: > > the second request cannot go through until the first request has completed … > with a multi threaded system, I cannot figure out a way to do that. Ideas > appreciated. dispatch_semaphore Documentation is currently here: https://developer.appl

Implemented -keyDown: in Yosemite NSViewController, but no class gets it

2014-08-26 Thread Jerry Krinock
I was so excited after watching WWDC Session 212 "Storyboards and Controllers on OS X” that I rewrote a little app I was working on to require Yosemite. All of the new view controller and tab view controller magic works as advertised, except that my view controller subclass, supposedly now in t

Re: Implemented -keyDown: in Yosemite NSViewController

2014-08-27 Thread Jerry Krinock
On 2014 Aug 27, at 06:56, Michael Babin wrote: > Is the window which contains your view (and view controller) the key window? Thank you, Michael. I think so. My app’s title is showing in the menu bar; and this is its only window. It is frontmost in the z-direction, and the three buttons in

Re: Implemented -keyDown: in Yosemite NSViewController, but no class gets it

2014-08-27 Thread Jerry Krinock
On 2014 Aug 27, at 09:05, Ken Thomases wrote: > And is the view the first responder? Does it return YES from > -acceptsFirstResponder? It doesn’t seem to matter. To answer your question, I put this code into my view controller: #if ACCEPT - (BOOL)acceptsFirstResponder { return YES ; }

Re: Implemented -keyDown: in Yosemite NSViewController, but no class gets it

2014-08-27 Thread Jerry Krinock
> On 2014 Aug 27, at 09:36, Ken Thomases wrote: > > I don't think it makes any sense to make the view _controller_ return YES > from -acceptsFirstResponder. You have to make your view accept first > responder. That's the thing being clicked on. -acceptsFirstResponder is > *not* sent up the

Re: Implemented -keyDown: in Yosemite NSViewController

2014-08-27 Thread Jerry Krinock
Unfortunately, I must put this issue on indefinite hold because, upon creating a new project to demo the problem, Xcode 6 beta 6 now crashes whenever I drag a Tab View Controller out of the Library into a storyboard and touch it in the Interface Builder. Even after a restart. It is Apple Bug

Re: How to Validate CoreData attribute value for uniqueness

2014-08-31 Thread Jerry Krinock
Hello, Motti. I read your post. All 600+ words :) > On 2014 Aug 30, at 03:58, Motti Shneor wrote: > I would gladly settle on a UI-only validation (meaning, something that would > validate a text field upon end-edit-session= I would pursue that. > but I don't know how to hook this on a bound

Re: Power Nap/wakeup

2014-09-01 Thread Jerry Krinock
> On 2014 Sep 01, at 14:39, Jim Geist wrote: > > Is there any way to set a timer to fire when the system is in full sleep Register an observer of NSWorkspaceWillSleepNotification. > or a public API to Power Nap? I’ve never seen any. App Nap, yes. Power Nap, no. ___

Re: Generating Core Data classes in Swift

2014-09-05 Thread Jerry Krinock
On 2014 Sep 05, at 20:22, Jim Geist wrote: > Workaround other than hand-tweaking the class? You could use mogenerator instead of Xcode to generate your Core Data classes. Although I’ve not tried it yet, supposedly mogenerator now has a —-swift option. https://github.com/rentzsch/mogenerato

Re: Generating Core Data classes in Swift

2014-09-05 Thread Jerry Krinock
Correct link to mogenerator good sales pitch… http://raptureinvenice.com/getting-started-with-mogenerator/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the modera

Re: Add bindings for custom menu items' isHidden to (an attribute of) a custom object?

2014-09-08 Thread Jerry Krinock
Daryle, allow me to admit that I have not read much of your posts. I’m just going to give some general advice. Cocoa Bindings can be problematic, but the problems are worth it when they solve the otherwise-difficult problem of magically keeping a data model and view in sync. In the case of NS

Re: NSUserDefaultsController in a NIB when not using standardUserDefaults

2014-09-08 Thread Jerry Krinock
On 2014 Sep 08, at 11:09, Alex Kac wrote: > Is there a better way? How about redirecting standardUserDefaults, by sending it -addSuiteNamed: and -removedSuiteNamed: during launching? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Add bindings for custom menu items' isHidden to (an attribute of) a custom object?

2014-09-08 Thread Jerry Krinock
On 2014 Sep 08, at 18:42, Daryle Walker wrote: > Using Bindings puts the visibility synchronization code in the best spot, the > potentially affected menu items themselves. I see what you mean. > The KVO method came to mind first since I didn’t know about menu delegates > until later. I gues

Re: Cleaning up after manual Core Data migration

2014-09-12 Thread Jerry Krinock
On 2014 Sep 11, at 15:38, Rick Mann wrote: > The problem is, I now have to specify the destination URL explicitly, and I'm > not able to give it the source URL. So, I create a new sqlite data file, and > that's fine. But the old sqlite DB actually has three files (DB.sqlite, > DB.sqlite-shm,

Want NSTableView NSOutlineView to load lazy like iOS?

2014-09-15 Thread Jerry Krinock
OS X app has an NSOutlineView with a data source. Clicking on a disclosure triangle to expand an item that has 13,000 children causes its data source to immediately receive -outlineView:child:ofItem: 13,000 times, on the main thread. The app presents a beachball until it’s over, which is unacc

Re: Want NSTableView NSOutlineView to load lazy like iOS?

2014-09-15 Thread Jerry Krinock
On 2014 Sep 15, at 11:56, Kyle Sluder wrote: > Are you using a view-based outline view? No. It is cell-based. App currently runs in Mac OS X 10.6. > Does your outline view have constant row heights, or are you > implementing -tableView:heightOfRow:? Constant row heights. I am not implement

Re: Want NSTableView NSOutlineView to load lazy like iOS?

2014-09-15 Thread Jerry Krinock
On 2014 Sep 15, at 12:35, Kyle Sluder wrote: > Can’t very well keep “only the onscreen views” if the table isn’t view-based… Makes sense! Are you implying that lazy loading is a side benefit of view-based tables, and hence that this performance bottleneck is a legacy that I could fix by drop

Re: Want NSTableView NSOutlineView to load lazy like iOS?

2014-09-15 Thread Jerry Krinock
On 2014 Sep 15, at 12:47, Ken Thomases wrote: > Check the places where you can control how the outline view sizes the columns. It seems that I only set column widths during -awakeFromNib. Definitely not upon expanding an item. > In particular, from the docs for -[NSOutlineViewDelegate > out

Re: Want NSTableView NSOutlineView to load lazy like iOS?

2014-09-15 Thread Jerry Krinock
Well, I made a little demo project containing an NSOutlineView, cell-based with two text cell/columns, connected data source to app delegate, and in there implemented data source methods to supply 1000 items to the root. Result: Behaves lazily as desired. Initially, it asks for about 100 more i

Re: NSOutlineView not lazy when expanding items :(

2014-09-16 Thread Jerry Krinock
> On 2014 Sep 16, at 06:13, SevenBits wrote: > > Could you perhaps upload the source? I'd like to take a look at this, as I am > trying to do something like this as well. Here you go… https://github.com/jerrykrinock/NSOutlineViewLazinessDemo Unfortunately, it was easy to reproduce the proble

Re: NSOutlineView not lazy when expanding items :(

2014-09-16 Thread Jerry Krinock
> On 2014 Sep 16, at 10:29, Jens Alfke wrote: > > Maybe it's the animation that ends up dereferencing all the rows? I forget > whether there's a way to disable the animations on an NSOutlineView … I can’t find any such control, Jens. * * * Apparently, *someone* inside Apple knows how to make

Re: NSOutlineView not lazy when expanding items :(

2014-09-16 Thread Jerry Krinock
On 2014 Sep 16, at 15:23, Kyle Sluder wrote: > I'd try wrapping things in an NSAnimationContext with > allowsImplicitAnimation=NO. Though I'm not sure where you would have the > opportunity to wrap the built-in expand behavior. Yes, I’ve never understood “graphics contexts” and its new friend

Re: NSOutlineView not lazy when expanding items :(

2014-09-19 Thread Jerry Krinock
On 2014 Sep 18, at 12:51, Corbin Dunn wrote: > Have you logged a bug on this issue? On Sept 17, I filed a bug 18365579, on the slow behavior in Safari. Hmmm, maybe I should file a separate bug on the underlying AppKit behavior. With two teams getting it in their in-box, it has a better chanc

Re: Defer opening documents until app is fully inited

2014-09-20 Thread Jerry Krinock
On 2014 Sep 19, at 09:12, Mills, Steve wrote: > Our app init (called from applicationWillFinishLaunching) needs to put up > some modal dialogs. I’m surprised that works. I think I was in a similar situation about 4 years ago. http://www.cocoabuilder.com/archive/cocoa/293279-very-simple-de

-[NSTabView mouseDown:] blows stack in Yosemite SDK

2014-09-28 Thread Jerry Krinock
anywhere in a document window (that contains a tab view), the blows its stack. See call stack below, prior to which I had clicked in the title bar. Any ideas or similar experiences, let us know. Possibly this is related to the addition of NSTabViewController in 10.10. Jerry Krinock … #130958

Re: Automatic data migration across two revisions

2014-09-28 Thread Jerry Krinock
> On 2014 Sep 28, at 22:21, Rick Mann wrote: > > Does the migration proceed in stages? That is, does it migrate version 5 -> 7 > by first migrating 5 -> 6 and then 6 -> 7? No. > Or do I have to add yet another mapping model and classes to go from 5->7? Yes, or add your own code to do what y

Re: -[NSTabView mouseDown:] blows stack in Yosemite SDK

2014-09-29 Thread Jerry Krinock
> On 2014 Sep 28, at 22:06, Kyle Sluder wrote: > > Do you have a cycle in your nextResponder chain? Remember than > NSViewController now inserts itself into the responder chain on 10.10. YES! That explains all of the forwardMethod() madness. My subclass of NSViewController, which I use for

Re: [SOLVED] NSOutlineView not lazy when expanding items

2014-09-29 Thread Jerry Krinock
To recap where we left off on Sept 19, the issue is that when an item in an NSOutlineView is expanded, its data source receives -outlineView:child:ofObject: once for *every* child, even if the item has 20,000 children but only 20 can fit in the window, causing poor performance if getting the ch

Re: NSPersistentDocument objects "gutted" after Duplicate, Rename in 10.9

2014-09-29 Thread Jerry Krinock
> On 2014 Sep 29, at 12:54, Romain Piveteau wrote: > > I am facing the exact same crash as you in my NSPersistentDocument app. Indeed it looks like the same to me. I have no news on this since I reported it six months ago. Actually, that’s good news, because my workaround, to close and reope

Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate

2014-10-14 Thread Jerry Krinock
> On 2014 Oct 14, at 05:42, Devarshi Kulshreshtha > wrote: > > I am trying to implement reset functionality in core data based sample app. > > I think that there are two ways to implement reset functionality: > > Approach 1: Delete sqlite file and then re-insert data As you’ve seen, this is

Re: Swift - Basic query regarding managedObjectContext method invocation from app delegate

2014-10-14 Thread Jerry Krinock
> On 2014 Oct 14, at 22:27, Devarshi Kulshreshtha > wrote: > > I know about NSBatchUpdateRequest Yes, that’s what I was thinking of. How about the reset + save ? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Re: Expected identifier or '(' and other errors occur after copying working code to a second machine

2014-10-28 Thread Jerry Krinock
> On 2014 Oct 28, at 09:44, Saunderson, Rik > wrote: > > Does anyone have any ideas about what's going on? I’ve seen Xcode do weird stuff like this too - just yesterday as a matter of fact, with an Xcode 6.1 beta. Particularly with the “Expected identifier or whatever” nonsense, I think tha

Re: NSMenuDelegate - menuNeedsUpdate:(NSMenu *): can I get key(s) pressed?

2014-10-28 Thread Jerry Krinock
> On 2014 Oct 27, at 20:14, Jim Prouty wrote: > > Is there code I can write to get the key(s) pressed during NSMenuDelegate's > menuNeedsUpdate:nsmenu method? Maybe override both -keyDown: and -keyUp: somewhere in your responder chain, and keep track of which key is currently down with your o

Re: NSStatusItem launches twice when checking launch at login

2014-10-31 Thread Jerry Krinock
Sorry I’m not helping with your main question. Just a couple comments on sideshow issues. > On 2014 Oct 31, at 15:07, Lorenzo Thurman wrote: > > Now there are actually two separate processes, Top shows two different PID’s. > I thought Launch Services was supposed to prevent this. No, it onl

Weird crash in -[NSSearchField setRecentSearches:]

2014-11-03 Thread Jerry Krinock
earchField since Mac OS X 10.3. One weird thing is that when I option-click on -setRecentSearches: in Xcode, it gives me the Swift declaration and says that it is available in OS X 10.10 or later. I don’t see any other methods behaving like that. Thanks, Jerry Krinock __

Re: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Jerry Krinock
> On 2014 Nov 04, at 01:33, Quincey Morris > wrote: > > The fact that NSNotificationCenter is involved tells you that this is *not* > KVO related. OK, then that makes me even more upset that all I can get from po $rdi, po $rdx, po $rcx, etc. when I need them nowadays is those damned “Couldn’

Re: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-07 Thread Jerry Krinock
> On 2014 Nov 07, at 14:14, Greg Parker wrote: > > Which frame are you in when you try to read the register (the top frame, or > some other frame)? Some other. #11 in this call stack: #0 in strlen () #1 in strdup () #2 in objc_class::nameForLogging() () #3 in cache_t::bad_cache(objc_

Re: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-09 Thread Jerry Krinock
> On 2014 Nov 07, at 16:02, Greg Parker wrote: > > You may have better luck tracing it from the other side. Run to that line in > appendToRecentSearches:, set a breakpoint on -[NSNotificationCenter > postNotificationName:object:userInfo:], and step over your line. At those > breakpoints you s

Re: Weird crash in -[NSSearchField setRecentSearches:]

2014-11-10 Thread Jerry Krinock
> On 2014 Nov 10, at 15:37, Lee Ann Rucker wrote: > > Do you implement any of the delegate methods corresponding to the > notifications? Cocoa will add notifications for you instead of bothering with > "respondsToSelector:" all the time. Thank you, Lee Ann. No, I can’t find any corresponding

Re: NSPersistentDocument, Export (Save As) and wal/shm

2014-11-15 Thread Jerry Krinock
> On 2014 Nov 15, at 13:38, Fritz Anderson wrote: > rdar://18994451; I classified it as a data-loss bug, given the near-certainty > of the loss of the journal files. Indeed it is, Fritz, for the reasons you stated. Here was my version, Bug 15873041: http://openradar.appspot.com/radar?id=5268

Re: Making the Versions Browser less of a dog

2014-11-20 Thread Jerry Krinock
> On 2014 Nov 19, at 20:36, Graham Cox wrote: > > Is there a sound way to determine at document creation time whether the VB is > active or not? Try the term “viewing mode”, as in-[NSDocument inViewingMode]. The documentation leaves me unsure as to whether or not “viewing mode” == “versions

  1   2   3   4   5   6   7   8   9   10   >