Re: No selectedObjects After Insert:
Re: No selectedObjects After Insert:
- Subject: Re: No selectedObjects After Insert:
- From: Keary Suska <email@hidden>
- Date: Sat, 04 Nov 2006 11:30:37 -0700
- Thread-topic: No selectedObjects After Insert:
on 11/3/06 7:05 PM, email@hidden purportedly said:
>> on. The problem I am having is that after the -insert: is executed,
>> -selectedObjects is empty. I need to access the currently selected
>> object so
>> I can present an editing dialog for the selection contents. I can't
>> use
>> -selection (which I haven't checked for validity) since I need to
>> access
>> methods not supported by the proxy object.
>
> - You didn't specify if the UI had a selection but the -
> selectedObject was empty, or if they were both empty.
The UI displays the new row as selected (inserting into NSTableView), but
selectedObjects is empty.
> - You *might* have some success setting up KVO observation on -
> selectedObject
selectedObjects is observable, but I would have to observe it from the
NSArrayController, which seems odd, but I imagine it would work. Hard to say
whether this would be a better solution than simply overriding the -insert
method.
> - You could also try using -selectedIndex as a way to fish the proper
> object out of -arrangedObjects
-selectedIndex returns 2147483647 (probably -1 unsigned), so that's a no go.
on 11/3/06 7:48 PM, email@hidden purportedly said:
> On Nov 3, 2006, at 9:05 PM, Scott Stevenson wrote:
>
>> - Some NSController subclasses perform their actions in a delayed
>> manner, so that might be what you're seeing.
>
> this is likely it. This is noted in the conceptual doc for Cocoa
> bindings (Providing Controller Content)
>
> Note: In Mac OS X v10.4 the target-action methods are deferred so
> that the error mechanism can provide feedback as a sheet.
>
> But not in the reference... and it should be. I'll fix that.
I have to say, this note, had I seen it, would not have been informative at
all. The question is, which target-action methods? I am seeing everything
executing as expected and without delay except for the NSArrayController
updating it's *own* properties relating to the selection, which it already
knows without needing any information from anywhere else. And what error
would it be waiting for? There doesn't appear to be any error returning
methods being called. Or there could be, which indicates to me it would be
more useful for the docs to actually spell out what the objectcontrollers
are doing (i.e. method calls).
Sorry for the rant but the most frustrating part of Cocoa development is the
lack of *detailed* comprehensive information. Or at least information that
doesn't require reading five different doc sections that aren't
cross-referenced to answer one relatively simple question.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden