undo prepareWithInvocationTarget KVC
undo prepareWithInvocationTarget KVC
- Subject: undo prepareWithInvocationTarget KVC
- From: Steven Spencer <email@hidden>
- Date: Sun, 3 Jul 2005 01:18:20 +0100
Hello,
In my project, the following line of code works :
[[[self undoManager] prepareWithInvocationTarget:[myArray
objectAtIndex:0]] setTarget:@"Hello"];
myArray is an NSArray containing instances of class myObj.
Class myObj has two methods :
- (void)setTarget:(NSString *)aString;
- (NSString *)target;
myArray is bound to a tableview column.
When I replace the line with :
[[[self undoManager] prepareWithInvocationTarget:[myArray
objectAtIndex:0]] setValue:@"Hello" forKey:@"target"];
the following errors can occur :
sigsev,
sigbus,
[<NSCFString 0x33d950> valueForUndefinedKey:]: this class is not key
value coding-compliant for the key target.
Does anyone know why it's looking for the key "target" in a string
instead of a myObj instance ?
The error occurs after the prepareWithInvocationTarget code has run,
when a new row is selected in the tableview.
Thanks for any insight.
- Steve Spencer
_______________________________________________
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