Re: How to tell if NSArrayController has a selected CoreData instance?

2009-10-01 Thread Timothy Reaves
On Sep 30, 2009, at 7:53 AM, Mike Abdullah wrote: -[NSArrayController selectedObjects] does not return proxies, it returns the real thing. On the other hand: -[NSArrayController selection] returns a proxy that represents the overall selection NSTreeController uses proxies to represent its

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-30 Thread Mike Abdullah
On 30 Sep 2009, at 13:31, Timothy Reaves wrote: On Sep 29, 2009, at 7:10 AM, "Timothy Reaves" wrote: What makes you think you can? Logically, you shouldn't be able. I'd imagine selectedObjects is always going to return an index set; it'd just be empty with no selection. I did try comp

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-30 Thread Timothy Reaves
> On Sep 29, 2009, at 7:10 AM, "Timothy Reaves" > > wrote: > >> What makes you think you can? Logically, you shouldn't be >> able. I'd >> imagine selectedObjects is always going to return an index set; it'd >> just be empty with no selection. I did try comparing it to >> NSNoSelectionMarke

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Kyle Sluder
On Sep 29, 2009, at 7:10 AM, "Timothy Reaves" > wrote: What makes you think you can? Logically, you shouldn't be able. I'd imagine selectedObjects is always going to return an index set; it'd just be empty with no selection. I did try comparing it to NSNoSelectionMarker just in case, an

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Timothy Reaves
> On Sep 28, 2009, at 18:11, Kyle Sluder wrote: > >> On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves >> wrote: >>> Well, I was hoping to bind buttons enabled property. If I use a >>> regular NSArray backed controller this works. And you can't bind (at >>> least I don't know how) with selecte

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-29 Thread Timothy Reaves
> On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves > wrote: >>     Well, I was hoping to bind buttons enabled property.  If I use a >> regular NSArray backed controller this works.  And you can't bind (at >> least I don't know how) with selectedObjects.  But you can with >> selection, and an NSNotN

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-28 Thread Quincey Morris
On Sep 28, 2009, at 18:11, Kyle Sluder wrote: On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves wrote: Well, I was hoping to bind buttons enabled property. If I use a regular NSArray backed controller this works. And you can't bind (at least I don't know how) with selectedObjects. But you

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-28 Thread Kyle Sluder
On Mon, Sep 28, 2009 at 6:02 PM, Timothy Reaves wrote: >     Well, I was hoping to bind buttons enabled property.  If I use a > regular NSArray backed controller this works.  And you can't bind (at > least I don't know how) with selectedObjects.  But you can with > selection, and an NSNotNil value

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-28 Thread Timothy Reaves
> On Mon, Sep 28, 2009 at 2:28 PM, Timothy Reaves > wrote: >>        What is the correct way to determine if that proxy represents an >> actual entity? > > If you need to determine if there is a selection, you want to use the > selectedObjects property. If you want to bind *through* the > selecti

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-09-28 Thread Kyle Sluder
On Mon, Sep 28, 2009 at 2:28 PM, Timothy Reaves wrote: >        What is the correct way to determine if that proxy represents an > actual entity? If you need to determine if there is a selection, you want to use the selectedObjects property. If you want to bind *through* the selection, then you

How to tell if NSArrayController has a selected CoreData instance?

2009-09-28 Thread Timothy Reaves
When you call [anArrayController selection] for an Entity-backed NSArrayController, you always get an instance of _NSControllerObjectProxy back. Even when there is no object selected. It's not until you send a message to that proxy that you get unrecognized selector error. What is the