Re: NSLayoutConstraint crash

2018-03-16 Thread David Catmull
want to use to see what is actually > going on. > > Constraints is a very big topic with many things to learn and control. > They are > very powerful, and thus very maddening when they don’t work they way you > understand. Take the time to learn how to use them, and you will be muc

Re: NSLayoutConstraint crash

2018-03-16 Thread David Catmull
I might try it, but it's difficult to do accurately because the views are assembled programmatically - it's dynamically generated based on the data read in. On Fri, Mar 16, 2018 at 10:37 AM, Richard Charles wrote: > > > On Mar 16, 2018, at 9:03 AM, David Catmull > wrote:

Re: NSLayoutConstraint crash

2018-03-16 Thread David Catmull
I found that in my googling, but since I'm not changing priorities, it wasn't helpful. On Fri, Mar 16, 2018 at 10:06 AM, Richard Charles wrote: > > > On Mar 16, 2018, at 9:03 AM, David Catmull > wrote: > > > > After I set up a somewhat complex view hie

NSLayoutConstraint crash

2018-03-16 Thread David Catmull
After I set up a somewhat complex view hierarchy, I'm getting a crash with this exception: 2018-03-16 08:59:21.814873-0600 App[31201:13046721] *** Assertion failure in -[NSLayoutConstraint setPriority:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1451/Foundation/Layout.s

NSTableView drag image - using the first column image

2017-12-15 Thread David Catmull
In my table view, when you drag an item, the drag image it uses comes from the column cell where the drag started, rather than using the cell from the first column where I have the icon and name. How do I make it use the first column? I'm looking at Apple's TableViewPlayground as an example, and t

Re: Are Core Data to-many relationships nullable?

2017-10-05 Thread David Catmull
Apparently the answer is that they should be declared nullable. Even though I've seen claims that the property will always return a set, apparently it's also allowable to assign it to nil to clear it out. On Thu, Oct 5, 2017 at 1:00 PM, David Catmull wrote: > I'm adding nullab

Are Core Data to-many relationships nullable?

2017-10-05 Thread David Catmull
I'm adding nullability notations to my Core Data classes for Swift interoperability, and I need to know whether the properties for to-many relationships should be considered nullable, or if they will always read as empty sets. Is there an authoritative answer for this? _

Window animates width but not height

2017-10-02 Thread David Catmull
I have a preferences window with a NSTabViewController hooked up to the toolbar for selecting tabs. I want the window to be resizable, and to resize iself if necessary when switching tabs to fit the new tab's size. I'm subclassing NSTabViewController with the following overload: override var sele

Dealing with validModesForFontPanel signature change

2017-09-14 Thread David Catmull
In the 10.13 SDK, the return type for NSObject.validModesForFontPanel() changed from Int to NSFontPanel.ModeMask. This is problematic for backwards compatibility because the different signature means it's considered to be a new function, different from the one that's been around since 10.3. If I s

Process.launch() in Swift

2017-05-31 Thread David Catmull
The documentation for Process.launch() (the equivalent of -[NSTask launch]) says it "raises an NSInvalidArgumentException if the launch path has not been set or is invalid or if it fails to create a process", and yet the function is not marked as "throws". So what happens if I call it from Swift an

Re: Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
oblem, since they'll just be restored to the same values both times. On Thu, Feb 16, 2017 at 1:22 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Feb 16, 2017, at 11:32 , David Catmull wrote: > > > I am explicitly calling encodeRestorableState (in wi

Re: Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
Morris < quinceymor...@rivergatesoftware.com> wrote: > On Feb 16, 2017, at 10:09 , David Catmull wrote: > > > I'm working on using encodeRestorableState/restoreStateWithCoder to save > and restore the state of a window. (I'm doing this manually because I want > t

Can't restore first responder when restoring window state

2017-02-16 Thread David Catmull
I'm working on using encodeRestorableState/restoreStateWithCoder to save and restore the state of a window. (I'm doing this manually because I want to explicitly save my window state in the document and not just rely on the OS restoring its state as part of restoring the application state.) The pr

Xcode-like title bar using title bar accessory view

2016-09-19 Thread David Catmull
I'm trying to create a title bar resembling Xcode's, where toolbar-like controls replace the standard window title in the area to the right of the standard 3 buttons. So far, I've added a title bar accessory view and set the window's titleVisibility to hidden. But the results aren't quite right.

Re: Unit testing with mixed Swift & Objective C

2016-07-18 Thread David Catmull
target. Using an auto-generated header from another target is kind of a hack, but it works, and it's the simplest solution so far, so I'm going with it for now. On Sun, Jul 17, 2016 at 2:16 PM, David Catmull wrote: > After converting some parts of my project to Swift, I've run in

Unit testing with mixed Swift & Objective C

2016-07-17 Thread David Catmull
thout that, I'm looking at two alternatives for the NSArray iterating scenario: - Rewrite the function that does the iterating, using Objective C so that it doesn't do the type checking. - Rewrite the function that creates the array, using Swift so that hopefully the classes will match

Re: Sidebar outline view, rowSizeStyle, and bold text

2016-06-10 Thread David Catmull
OK, thanks. I wasn't thinking of bold being affected by row size, but I guess it makes sense that it's going to reset the font entirely. On Fri, Jun 10, 2016 at 10:46 AM, corbin dunn wrote: > > On Jun 10, 2016, at 7:58 AM, David Catmull wrote: > > I have a vie

Sidebar outline view, rowSizeStyle, and bold text

2016-06-10 Thread David Catmull
I have a view-based, sidebar-style NSOutlineView. For some items, I want to make the text bold. But if I change the rowSizeStyle to medium instead of the default (in awakeFromNib), the text doesn't display as bold. If instead I use a custom row size (in outlineView:heightOfRowByItem:) it works. Wha

Re: PDF image template comes out too small

2016-06-02 Thread David Catmull
about working with Affinity Designer. On Wed, Jun 1, 2016 at 12:30 PM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Jun 1, 2016, at 10:55 , David Catmull wrote: > > > On OS X. I have an NSSegmentedControl in my xib, with my template images > assigned to

Re: PDF image template comes out too small

2016-06-01 Thread David Catmull
On OS X. I have an NSSegmentedControl in my xib, with my template images assigned to the segments by specifying the image names. On Wed, Jun 1, 2016 at 10:36 AM, Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Jun 1, 2016, at 07:51 , David Catmull wrote: > >

PDF image template comes out too small

2016-06-01 Thread David Catmull
I'm trying to use PDF files as image templates for my segment controls, but they come out too small. I created them using Affinity Designer, adding the "Template" suffix. They end up getting drawn at half size in my controls. I tried changing the export DPI from the default (~144) to 72, but it ha

Re: Proper target for table cell view buttons

2016-04-09 Thread David Catmull
> On Apr 8, 2016, at 10:48 AM, Quincey Morris > wrote: > > You could verify this by simply removing the target connection that’s causing > the warning, and see if the action method still ends up in the right place. As has been pointed out, removing the target connection in the nib also remove

Re: Proper target for table cell view buttons

2016-04-08 Thread David Catmull
On Apr 7, 2016, at 1:23 PM, Quincey Morris wrote: > I don’t actually know the answer to the original question, but I wonder if > the problem is that (for a view-based table view) the cell view is archived > in a separate NIB file that’s generated when the storyboard or XIB containing > the tab

Re: Proper target for table cell view buttons

2016-04-08 Thread David Catmull
On Apr 7, 2016, at 11:45 AM, Fritz Anderson wrote: > > I’m curious about two things. > > (1) Which platform? OS X 10.11.3 > (2) Is your view controller not a table delegate already? I currently have the data source as the delegate, mainly because to me it makes more sense to have the delegat

Proper target for table cell view buttons

2016-04-07 Thread David Catmull
I have some buttons in my table cell views, and I wanted to set my view controller as their target, but Xcode warns that such objects “may only be connected to the table view’s delegate”. The things is, it works as is. Why does Xcode want me to do it that way? I plan to try refactoring to satis

Re: Does NSOutlineView's highlightedTableColumn work?

2016-04-04 Thread David Catmull
> Are you sure a (rather small) sort indicator didn't appear in the column's > header? No, nothing appeared there either. >> I’m trying to use the column highlight to indicate a view state unrelated to >> sorting… > > Don't do that. Don't try to hijack features intended for one semantic for

Does NSOutlineView's highlightedTableColumn work?

2016-04-04 Thread David Catmull
Is setting the highlightedTableColumn property on an NSOutlineView supposed to work? I’m expecting the column background to darken, but nothing seems to happen. Showing the column headers didn’t help (I normally have them hidden), and neither did setting a sort key for the column. I’m trying to

Detecting screen capture in progress

2014-04-18 Thread David Catmull
How can I detect when a screen shot selection (cmd-shift-4) is in progress? I have a custom window that I’m trying to make behave like a menu (it comes out of a status item). Part of this behavior is dismissing it when the user clicks on something else, which I detect using a CGEventTap. One cas

Full-height toolbar items

2013-06-16 Thread David Catmull
I'm working on a library for doing full-height toolbar items, like the center status display in Instruments, Xcode, and iTunes. I'm not completely finished yet, but I have reached a point where I'd like to share it. Feedback is welcome. https://github.com/Uncommon/UUFullHeightToolbar ___

Re: toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: and nibs

2013-06-12 Thread David Catmull
On Jun 12, 2013, at 5:14 PM, Keary Suska wrote: > Also, I suspect that the docs you cite might be saying that you would > subclass NSToolbar and implement that delegate method if you want to > intercept it. If I implement that method in a subclass, then it gets called with toolbar and itemIden

toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: and nibs

2013-06-12 Thread David Catmull
The documentation for toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: says that it's optional for nib toolbars, but it can still be used to "augment functionality". My experience is that it actually doesn't get called at all in the nib case, which isn't good because I want to know if my

PDF icons scaled wrong on retina displays

2012-10-12 Thread David Catmull
As recommended, I used PDF images for some of my button icons with the expectation that they would look nice on retina displays. They are nice and smooth, but they're also scaled a bit smaller than on a regular display. Example: http://dl.dropbox.com/u/10822169/Screen%20Shot%202012-10-12%20at%20

Re: Icon Overlay on Mac OSX

2012-07-19 Thread David Catmull
Uli Kusterer wrote: > In the old days, one could use Icon Services calls to change the icon used > for a particular file type, that might even save you the renaming, but Icon > Services is probably considered "old" API these days, and I'm not sure if > changes to icons in your app using Icon Se

Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 27, 2012, at 12:27 PM, Jens Alfke wrote: > The good news is that these APIs often become public in later OS releases, > especially if developers file bugs clamoring for them (hint hint). Done: bug 10766939. -- David Catmull uncom...@uncommonpla

Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 26, 2012, at 9:03 PM, Mark Alldritt wrote: > I'm looking for a way to make a view-based Toolbar Item that occupies the > full height of the toolbar (i.e. including the space normally reserved for > the toolbar item's label). Xcode 4 does this for its "status" display, and I > have a sim

Status toolbar item like Xcode and Instruments

2011-11-14 Thread David Catmull
Customize sheet. This leads me to suspect there's a relatively non-messy way to implement this. * <http://stackoverflow.com/questions/6169255/is-it-possible-to-draw-in-the-label-area-of-nstoolbar> -- David Catmull uncom...@uncommonplace.com

Re: Help with view constraints

2011-10-30 Thread David Catmull
ithub.com/Uncommon/Xit/tree/status> It's a rewrite of the GitX git client. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mode

Help with view constraints

2011-10-28 Thread David Catmull
ld be good for, but I can't figure it out. I think there are basically two questions: - What is the simplest way to adjust the text field's height to fit its content? - How do (or can) I set up constraints so that the window and other controls will accommodate that change? -- Davi

Source list groups hidden by default

2011-10-18 Thread David Catmull
them programmatically, but that doesn't work if the group is empty. I could expand it when I add children, but then I have to keep track of whether it's for the first time or if I'm just refreshing. So how do I make my groups shown by default? -- David Catmull uncom...@uncommo

Full-height toolbar item

2011-10-17 Thread David Catmull
How can I make a toolbar item that takes up the full height of the toolbar, including the space where the label would normally be? Simply setting the label to an empty string doesn't seem to do it. I want to make something like Xcode 4's status display. -- David Cat

Contextual menu commands in the Finder

2011-02-15 Thread David Catmull
ply to files in certain locations, and it looks like I can only filter by file type. Is there no way to filter by location too? It looks pretty lame to have to let the commands always appear, and then tell the user afterwards, "No, sorry, you can't really do this to that file.&

Animated progress bar in custom menu item view

2010-11-02 Thread David Catmull
I'm looking a the MenuItemView sample code: http://developer.apple.com/library/mac/#samplecode/MenuItemView/Introduction/Intro.html This sample shows various views and controls in a menu, including an indeterminate progress bar - but it doesn't animate (even though startAnimation is called). I a

Re: Core Data: many-to-many relationships not being saved

2010-07-17 Thread David Catmull
addObject:tag]; I discovered the answer as I was preparing to post my question on Stack Overflow. It was yet another case of trying to anticipate all the obvious "did you try this" responses, and finding the answer myself in the process. On Jul 10, 2010, at 9:03 AM, David Catmull

Core Data: many-to-many relationships not being saved

2010-07-10 Thread David Catmull
x27;re not transient. This is the first time I've had trouble with object relationships. What could be causing it? The project is on GitHub if you want to try it out: http://github.com/Uncommon/Budget-Machine -- David Catmull uncom...@uncommonplace.com htt

Re: C arrays as __block variables

2010-06-27 Thread David Catmull
I had a situation where I was accessing a C array from inside a block. It worked fine until I upgraded to Xcode 3.2.3; then I started to get errors. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mailing list

Re: Core Data: binding to a sum

2010-04-07 Thread David Catmull
On Apr 7, 2010, at 10:19 AM, Keary Suska wrote: > On Apr 7, 2010, at 9:14 AM, David Catmull wrote: >> ..so I take it the particular NSSet variant used by Core Data doesn't >> support observing @sum. Or did I do that wrong? > > Yes, because you are trying to observe an e

Core Data: binding to a sum

2010-04-07 Thread David Catmull
etItems, but I'm struggling with the best way to do that. -- David Catmull uncom...@uncommonplace.com___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: Make sheets open instantly

2010-01-19 Thread David Catmull
On Jan 18, 2010, at 5:19 PM, Chris Hanson wrote: > On Jan 18, 2010, at 2:43 PM, David Catmull wrote: > >> Is there any way to make sheets open instantly, instead of animating? I'd >> just like to speed up my unit tests. > > Why do your unit tests need to bring up

Make sheets open instantly

2010-01-18 Thread David Catmull
Is there any way to make sheets open instantly, instead of animating? I'd just like to speed up my unit tests. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P

Re: Core Data derived property not recognized after save & reopen

2009-11-18 Thread David Catmull
opping the derived property approach and using predicates that access the original date property directly. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Core Data derived property not recognized after save & reopen

2009-11-18 Thread David Catmull
property weirdness entirely. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.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

Core Data derived property not recognized after save & reopen

2009-11-17 Thread David Catmull
ple way to write a unit test that simulates closing an reopening a Core Data document? I want to avoid actual file operations for the sake of simplicity, but NSPersistentDocument does not implement the dataOfType:error: method. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace

Bindings vs MOC change notification

2009-11-13 Thread David Catmull
of individual callbacks, and I worry that that would be a bottleneck. Recommendations? Other options? Thanks, -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Unit test crash inside NSTableView

2009-11-11 Thread David Catmull
trigger and I can examine the object in the debugger after the crash. It looks fine. The outline view's _delegate and _dataSource still point to it, too. -- David Catmull uncom...@uncommonplace.com http://www.uncommonplace.com/ ___ Cocoa-dev mail

Unit test crash inside NSTableView

2009-11-11 Thread David Catmull
for that in the unit test and it was fine. When I run the app normally everything works. I create the document by calling [[NSDocumentController sharedDocumentsController] openUntitledDocument:YES error:&e]. Is there something else I need to do so that everything get set up correc

Re: NSArrayController inside NSTreeController?

2009-11-04 Thread David Catmull
On Nov 4, 2009, at 10:21 AM, Matthew Lindfield Seager > wrote: You may need to implement NSOutlineView's data source methods. I considered that, but I'm hoping to avoid having to re-implement all the stuff that already works in the normal table view/array controller cas

NSArrayController inside NSTreeController?

2009-11-04 Thread David Catmull
to manage that is to use an array controller. I tried returning the array controller's arrangedObjects as the children of a group object, but when items are added they don't appear in the source view. I'm not sure where to go from there. -- David Catmull uncom...@uncommo