Checkbox Array and Bindings
Checkbox Array and Bindings
- Subject: Checkbox Array and Bindings
- From: Chris Outwin <email@hidden>
- Date: Fri, 6 Jan 2006 09:51:14 -0600
There is a use of bindings for which I have found no tutorials or
documentation. I'm still new to bindings and would be grateful for
help.
I have a matrix of two checkboxes created in IB. If a box is
checked, it should be added to a selected objects mutable array via
bindings. This array is enumerated in association with a switch
statement in a controller object allocated in IB. The system look
like this in IB:
Controller (with mutable array) <- content - NSObjectController <-
contentArray =selection.(mutable array) [NSObjectController]
The checkbox matrix is bound to the NSArrayController's
selectedObjects. Bind to: is set to the array controller. The
controller key: is set to selectedObjects.
The code for the mutable array in the controller object is:
- (void)setMyChecks:(NSMutableArray*)newChecks {
if (myChecks != newChecks ) {
[myChecks release];
myChecks = [[NSMutableArray alloc] initWithArray:newChecks];
[self callTest];
}
}
When I run the program and click one of the boxes, the Run Log
prints: 2006-01-06 09:17:17.731 MatrixTest[468] *** -[NSCFArray
addObject:]: attempt to insert nil.
What have I done wrong? Is there a tutorial which uses a matrix,
mutable array and bindings?
_______________________________________________
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