Re: Custom Cell Bindings

2011-09-03 Thread Seth Willits
On Sep 3, 2011, at 10:43 PM, Ken Thomases wrote: > On Sep 3, 2011, at 10:20 PM, Seth Willits wrote: > >> Hence, my thinking is since it doesn't work right out of the box as I'd >> expect, then perhaps there's some undocumented thing I'm supposed to be >> doing in my NSActionCell subclass which

Re: Custom Cell Bindings

2011-09-03 Thread Ken Thomases
On Sep 3, 2011, at 8:35 PM, Quincey Morris wrote: > [I]t's possible that the table configures the NSCell by binding the correct > object/property combination to it just before editing, and it really is the > NSCell that makes the data model value replacement. For what it's worth, I checked this

Re: Custom Cell Bindings

2011-09-03 Thread Seth Willits
On Sep 3, 2011, at 7:23 PM, Quincey Morris wrote: > OK, I went back to your original post, and I think I understand what you said > now. Seems so! > The NSCell goes only as far as replacing its own "objectValue" with the > new/edited value. Correct. That's what I am expecting. > From there

Re: Custom Cell Bindings

2011-09-03 Thread Quincey Morris
On Sep 2, 2011, at 17:12 , Seth Willits wrote: > Say I have a custom NSCell subclass (or maybe NSActionCell) which implements > some custom UI for manipulating some immutable value type which I can't use > any of the standard cell subclasses for. If this cell is the data cell in a > table colum

Re: Custom Cell Bindings

2011-09-03 Thread Quincey Morris
On Sep 3, 2011, at 17:45 , Seth Willits wrote: > Let's go with an even simpler example. With a checkbox button cell, you click > the button and a whole new value is generated. > > So let's say I make my own NSCell subclass which does the same thing. You > click on something in the cell and a w

Re: Custom Cell Bindings

2011-09-03 Thread Seth Willits
On Sep 3, 2011, at 12:44 AM, Quincey Morris wrote: > Really, I'm sorry if I'm misunderstanding, but I think one of two things is > going on here: > > 1. You're trying to use a NSCell to modify a value object. That may work > fine, but there's a conceptual difference that doesn't fit the way we

Re: Best Practices for Associating a File Extension With a File in XCode 4?

2011-09-03 Thread Kyle Sluder
On Sat, Sep 3, 2011 at 5:14 PM, Vik Rubenfeld wrote: > If I'm using saveDocumentWithDelegate:didSaveSelector:contextInfo, what is > the correct way for me to communicate the list of suitable extensions to the > Save panel? NSDocument ascertains this information from calling -writableTypesForSav

Re: Best Practices for Associating a File Extension With a File in XCode 4?

2011-09-03 Thread Vik Rubenfeld
Thanks very much for this info. I've been coding in Cocoa all year, but I'm still a newbie to plenty of stuff, including this. I have developed code that does permit me to append the file extension to the filename: - (IBAction) saveDocumentAs:(id)sender { NSSavePanel* theSavePanel = [[NSSav

Re: Best Practices for Associating a File Extension With a File in XCode 4?

2011-09-03 Thread Quincey Morris
On Sep 3, 2011, at 15:21 , Vik Rubenfeld wrote: > I went to the XCode App Properties panel and added an Exported UTI with file > extension of "CAQuickLook". However, saving the document, still does not > append a file extension to the file name. > > What am I missing? You're not missing anyth

Re: Best Practices for Associating a File Extension With a File in XCode 4?

2011-09-03 Thread Vik Rubenfeld
Thanks very much for your advice. After receiving your email I set the filetype in the object's init method: [self setFileType:FILEEXTENSION_QUICKLOOK]; //#define FILEEXTENSION_QUICKLOOK @"CAQuickLook" However, saving the file as before, still does not append a file extension. On

Re: KVO on objects in NSArrayController

2011-09-03 Thread Kyle Sluder
On Sat, Sep 3, 2011 at 12:12 AM, Trygve Inda wrote: > I understand that... I think the alternative would be to register an > observer on all 8000+ objects in the array. Yes, this is the expected pattern with KVO. Contrary to what you might think at first, it is *fast*. To use OmniPlan 2 as an ex

Re: KVO on objects in NSArrayController

2011-09-03 Thread Dave Fernandes
I agree, it is certainly a valid and useful design pattern that I use as well. But I just wasn't sure that it is needed in the OP's case. From the part that I read (and I missed the first part of the thread), there was no mention of which objects needed to be notified. On 2011-09-03, at 10:52 A

Re: KVO on objects in NSArrayController

2011-09-03 Thread Jerry Krinock
On 2011 Sep 03, at 07:34, Dave Fernandes wrote: > I'm coming late to this conversation, but couldn't you just add a -[MyObject > setMarked:] method that would then be called to change the 'marked' > attribute/property? It can do anything else it wants after making the change. > Why use notifi

Re: KVO on objects in NSArrayController

2011-09-03 Thread Dave Fernandes
I'm coming late to this conversation, but couldn't you just add a -[MyObject setMarked:] method that would then be called to change the 'marked' attribute/property? It can do anything else it wants after making the change. Why use notifications at all? Is it some other object that needs to be n

Re: Custom Cell Bindings

2011-09-03 Thread Ken Thomases
On Sep 3, 2011, at 1:16 AM, Seth Willits wrote: > The scenario is analogous to a custom text field cell where the cell is > displaying and editing an immutable NSString. With NSTextFieldCell when you > edit the text, the table view and cell cooperate to update value at the other > end of the bi

Re: KVO on objects in NSArrayController

2011-09-03 Thread Quincey Morris
On Sep 2, 2011, at 23:34 , Jerry Krinock wrote: > Indeed it is, *if* you literally want the notification, as you said in your > original post, "whenever the user toggles a … checkbox". Sure. > However, if, as is more commonly the case, you actually need a notification > whenever the 'marked' a

Re: Custom Cell Bindings

2011-09-03 Thread Quincey Morris
On Sep 2, 2011, at 23:16 , Seth Willits wrote: > I'm well aware of all of that. Well, I thought you were, but I still think the issue is in the way you're asking your question. See below, where I have another go at getting it right. > I explicitly stated the object is immutable because it is v

Re: KVO on objects in NSArrayController

2011-09-03 Thread Trygve Inda
> > On 2011 Sep 02, at 22:22, Trygve Inda wrote: > >>> Briefly, you can configure the checkbox cell (either in IB or >>> programmatically) to have an action… > >> I think this sounds like a much better option than trying to use KVO. > > Indeed it is, *if* you literally want the notification, as