Re: Table column bindings to NSArrayController not working
Re: Table column bindings to NSArrayController not working
- Subject: Re: Table column bindings to NSArrayController not working
- From: Keary Suska <email@hidden>
- Date: Thu, 17 May 2007 13:10:33 -0600
- Thread-topic: Table column bindings to NSArrayController not working
on 5/17/07 6:54 AM, email@hidden purportedly said:
> I'm having a really strange problem: I'm using bindings for the
> main table in my app, which displays content based on Core Data
> objects, and that works fine. But for a smaller table, I'm
> displaying content bound to an NSArray in my document controller
> class (MyDocument).
> Ideally, the second table (the one not based on Core Data) would
> update after modifications made to its content array (or rather the
> bound values of its columns, via an NSArrayController) during the
> first table's -(void)tableViewSelectionDidChange:(NSNotification *)
> aNotification method. Oddly enough GDB is telling me that that
> method is working as it should; the array (called metadata) is being
> updated, which leads me to believe there is a problem with the
> bindings -- either that, or I did something wrong with how/where I
> declared and allocated the array. I'm posting the relevant portions
> of my code, as well as my bindings settings for that table, below;
> could you please take a look and tell me if I'm doing anything wrong?
At first glance, you are not updating your array in a Key-Value-Observing
(KVO) compliant way. It also appears that you do not understand how
NSArrayControllers and bindings work, unless there are very significant
pieces of code missing. For instance, you almost never call -prepareContent
unless you are subclassing NSArrayController (or any other NSController
subclass), or instantiating the controller in code.
You should probably re-read the key-value coding/observing docs, as well as
the bindings doc:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/inde
x.html
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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