I have a number of NSTextFields that are happily bound to NSString objects in the controller, and they work very well: if the textfield is updated, the corresponding NSString object is updated, as vice- versa. Now, in order to implement drag-and-drop, I have had to subclass NSTextField and set my textfields to that subclass. Everything works fine (including typing, paste, and the like) in terms of updating bindings, with the exception of drag-and-drop.

The problem is that when I drag-and-drop, the corresponding NSString object is not updated. The textfield display is updated. Here is the code I'm using in the textfield subclass:

- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{

        ...
                
        [self willChangeValueForKey:@"stringValue"];
        [self setValue:draggedFormulaString forKey:@"stringValue"];
        [self didChangeValueForKey:@"stringValue"];

    return YES;
}

Since I do not know the NSString object to which the textfield is bound at design time, I can't simply go in and set the value of the NSString and (hopefully) trigger a binding update. Is there any way to find out which NSString the textfield is bound to? Is there some other solution? Thanks.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to