When I use an NSArrayController
with instances of NSManagedObject
, I was under the impression that the following would give me its selected object:
[myArrayController selection]
However, this gives me an instance of some private NS Proxy class.
When I use:
[[myArrayController selectedObjects] objectAt: 0]
...all is fine and I have my instance of NSManagedObject
.
I understand the necessity for these methods as you can probably have lists which allow for multiple selection. I do not understand why selection
does not give me the instance of NSManagedObject
.
self
value:[[myArrayController selection] valueForKey:@"self"]
. Note that you have to use KVC to do this, calling theself
method will return the proxy. – Pilkington