New bindings for NSArrayController
New bindings for NSArrayController
- Subject: New bindings for NSArrayController
- From: "Jim Thomason" <email@hidden>
- Date: Thu, 16 Nov 2006 11:36:15 -0600
I have an exceptionally complicated interface on one screen of an app
I'm developing. The complexity is required (it's finance. Damn
bankers), but a lot of the time the user won't need it. So I want to
provide a simple view as well.
It's all coredata based. In the complex view, you would see an
account, which has multiple line items. I have a table that lists my
accounts, then a second table bound to the selection of the account
table to display the line items.
But, some percentage of the time, the user won't need multiple line
items, so the simplified view provides only one.
I still have the accounts table, but now I would like to bind
individual text boxes to the selection, instead of another table.
I'd tried adding in a new method to NSArrayController - firstObject.
This would just return the first element in the arrangedObjects list.
I could then access its attributes. In my test app, it worked fine.
But, unfortunately, my simplified view is a bit more complicated.
While the firstObject binding works, it doesn't properly update. If I
add a new item, it doesn't refresh, if I change the selection, it
doesn't refresh, and so on.
I set up setKeys:triggerChangeNotificationsForDependentKey: to trigger
notifications for the firstObject parameter on changes in contentSet
and arrangedObjects, but that wasn't enough. I'm not sure if I'm just
missing the appropriate key to trigger off, of or if I need to
subclass and override other methods, or if this approach just wont'
work.
So now I turn to you all.
First question, of course, is, should I even be doing this? More aptly
stated, is there a better way?
Secondly, assuming I am on the right track, is there a list somewhere
of what other methods I'd need to overload in order to properly get my
notifications posted so my field refreshes?
Many thanks,
-Jim.....
_______________________________________________
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