Re: Validating values for NSArrayController
Re: Validating values for NSArrayController
- Subject: Re: Validating values for NSArrayController
- From: Jean-Francois Roy <email@hidden>
- Date: Wed, 26 Nov 2003 09:30:25 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thanks a lot, that was quite helpful. I was simply missing the validate
immediately option, I had implemented the validation methods but since
they didn't seem to get called, I was confused a bit.
On a different topic, is there a way to make a NSArrayController select
and put in editable mode the cell of a column of a new row it
[NSArrayController] just added to a table view?
On Nov 26, 2003, at 00:09, mmalcolm crawford wrote:
On Nov 25, 2003, at 5:09 PM, email@hidden wrote:
I have a small application that has a custom class used as the model
object of an NSArrayController object driving a NSTableView control.
I would like to be able to validate new values before they are
applied to the model, to filter things like negative numbers for
array indexes or other such kind of validation.
I am not sure, but I would suggest overriding the addObject: method.
This is almost certainly not the best approach. Apart from anything
else, it would associate validation logic with the controller rather
than with the model class where it probably belongs. Moreover,
addObject: will not help for existing objects whose values are
modified.
Key-value-coding has been extended to support validation in the model,
and this is also supported by "Validate Immediately" bindings in the
controller layer. See the "Manual Bindings" example at:
<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
Jeff Roy
- --
Co-Founder of MacStorm
Programmer at MacStorm
http://www.macstorm.org
email@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQE/xLkB9TJCJTtnjCQRAvo6AKCan9VwLlXbC4CDU1aAHbcAEhp9pQCcCk9a
hrUDplvAao67CSMVQEZ3kr0=
=bSN4
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.