NSArrayController index doesn't change when TableView selection changes
NSArrayController index doesn't change when TableView selection changes
- Subject: NSArrayController index doesn't change when TableView selection changes
- From: "Devraj Mukherjee" <email@hidden>
- Date: Tue, 12 Feb 2008 13:27:10 +1100
Hi everyone,
I am writing a Core Data application where my GUI has an
NSArrayController that talks to the Core Data objects and a TableView
that depends on the ArrayController to show various bits of data from
the objects, the usual Core Data dance :)
All works well, include being able to delete objects. But (and there's
always a but), I have a button that is handled by a controller object,
the controller object has a reference to the same NSArrayController as
the Nib file.
What I want to do is get the current selection from the
ArrayController. Now as I understand this is done using the
selectedObjects message, which kind of works. Except if I change the
index on the TableView it doesn't seem to change in the referenced
controller object. But obviously its able to delete the right object
using the remove message.
Any ideas anyone? thanks a lot.
Here is what I see if I write the selected object to NSLog.
2008-02-12 13:06:02.690 AsteriskBuddy[788:10b] <AXTCallEntity:
0x14332980> (entity: IncomingCall; id: 0x18d480
<x-coredata://4A86A077-9F4B-4B02-B069-9E9827EB0560/IncomingCall/p135>
; data: {
endDate = 2008-01-24 17:32:59 +1100;
phoneNumber = 0259082571;
startDate = 2008-01-24 17:32:55 +1100;
})
2008-02-12 13:06:09.105 AsteriskBuddy[788:10b]
AXTCallListWindowController is adding call from the Missed List
2008-02-12 13:06:09.106 AsteriskBuddy[788:10b] <AXTCallEntity:
0x14332980> (entity: IncomingCall; id: 0x18d480
<x-coredata://4A86A077-9F4B-4B02-B069-9E9827EB0560/IncomingCall/p135>
; data: {
endDate = 2008-01-24 17:32:59 +1100;
phoneNumber = 0259082571;
startDate = 2008-01-24 17:32:55 +1100;
})
2008-02-12 13:06:17.721 AsteriskBuddy[788:10b]
AXTCallListWindowController is adding call from the Missed List
2008-02-12 13:06:17.722 AsteriskBuddy[788:10b] <AXTCallEntity:
0x14332980> (entity: IncomingCall; id: 0x18d480
<x-coredata://4A86A077-9F4B-4B02-B069-9E9827EB0560/IncomingCall/p135>
; data: {
endDate = 2008-01-24 17:32:59 +1100;
phoneNumber = 0259082571;
startDate = 2008-01-24 17:32:55 +1100;
})
--
"I never look back darling, it distracts from the now", Edna Mode (The
Incredibles)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden