On 2010 Feb 03, at 07:32, Joe wrote:

> I have a NSTableView with a column of checkboxes. I have the checkbox value 
> bound to an NSInteger instance in a class which is in an array bound as the 
> content to an array controller.

The checkbox cell should not be bound to anything.  (Note: It's a checkbox 
cell, not a checkbox.)  The only way I've ever seen table/array controller 
"binding" work is to bind the *table column* to the array controller using 
Controller Key arrangedObjects.

> When the program starts the column is filled with 16 rows and the checkbox is 
> set to off ... the checkbox column gives the error...

Can't make an array into a BOOL.  That's expected, based on the binding you 
described.

> This column is not bound to a core data managed object. The other columns 
> are. I can get rid of this error if I remove the binding on the other columns 
> that are bound to core data managed objects.
> 
> So, the question is can a TableView have columns where some columns are bound 
> to core data managed objects and others to unmanaged objects? If not, then is 
> there a way to prevent changes to a managed object from causing the document 
> from being tagged as dirty and triggering the "Save" dialog when closing?

It does not matter whether objects are managed objects or not.  But what does 
matter is that all the columns in the table should be bound to the 
arrangedObjects of the same array controller.  I don't see your table would 
make any sense to the user otherwise.  The key paths to which different columns 
are bound may be mixed "managed properties" and "non-managed properties".  The 
latter may be regular instance variables or derived properties -- anything that 
is KVC-compliant.  Setter may be omitted if the corresponding table column/cell 
is not editable.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to