On Tuesday, December 22, 2009, Gerriet M. Denkmann wrote:
> What I ended up was: subclassing NSArrayController and overriding "newObject"
> to return a new object prefilled with some some nice values, including
> setting my uniqueKey to "undefined", "undefined_1", "undefined_2", etc.
> This will
On 22 Dec 2009, at 04:50, Sean McBride wrote:
> On 12/20/09 3:19 PM, Gerriet M. Denkmann said:
>
>> What I try to accomplish:
>> SomeEntity has a property called "uniqueKey" and this is (no big
>> surprise) meant to be unique.
>>
>> When the "UniqueKey" column in my table view gets edited,
>> v
On 12/20/09 3:19 PM, Gerriet M. Denkmann said:
>What I try to accomplish:
>SomeEntity has a property called "uniqueKey" and this is (no big
>surprise) meant to be unique.
>
>When the "UniqueKey" column in my table view gets edited,
>validateUniqueKey:error: gets called, I check the new value for
>
I think that you want to implement the awakeFrom* methods on NSManagedObject
rather than the validate* methods for your purposes.
But as for them never getting called, make sure that your NSArrayController
bindings are correct. Specifically that it's mapped to your NSManagedObject
subclass. Also
I think you misunderstand what -validateForInsert: and friends are for. They
use "insert" here in the sense of inserting into the persistent store.
So -validateForInsert: is called the first time the object is added to the
store (calling -[NSManagedObjectContext save:] ). From then on,
-validat
I have a document based Core Data app.
MyDocument.nib contains an NSTableView bound to an NSArrayController.
There also are "+" and "-" buttons, which send "add:" resp. "remove:" to the
array controller.
SomeEntity.m (subclass of NSManagedObject) implements validateForInsert:,
validateForUpdate