Re: Key-Value Binding problems
Re: Key-Value Binding problems
- Subject: Re: Key-Value Binding problems
- From: Scott Anguish <email@hidden>
- Date: Sun, 2 Nov 2003 23:51:16 -0500
At the very least you'd need to be using setValue:forKeyPath: rather
than forKey:
On Nov 2, 2003, at 8:10 PM, Kurt Marek wrote:
I've created some key-value bindings through IB to connect an
NSImageView subclass (myImageView) to an NSArrayController
(myArrayController).
I set up the valueURL of the myImageView as
myArrayController.selection.URLToPDFFile.
Now I'm trying to use drag and drop of a file from the Finder to set
this value. The drag and drop code is in myImageView. Here's a snippet:
if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:[[pboard
propertyListForType:NSFilenamesPboardType] objectAtIndex:0]];
[myArrayController setValue:fileURL forKey:@"selection.URLToPDFFile"];
[fileURL autorelease];
return YES;
}
I always get the following error when I try the drag and drop:
[<myArrayController 0x345310> setValue:forUndefinedKey:]: this class is
not key value coding-compliant for the key selection.URLToPDFFile
_______________________________________________
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.