• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Bindings Update with Drag-and-Drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings Update with Drag-and-Drop


  • Subject: Bindings Update with Drag-and-Drop
  • From: "K. Darcy Otto" <email@hidden>
  • Date: Fri, 17 Apr 2009 19:50:48 -0700

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Bindings Update with Drag-and-Drop [solved]
      • From: K.Darcy Otto <email@hidden>
  • Prev by Date: Bindings Update with Drag-and-Drop [solved]
  • Next by Date: Re: Keeping IB class instance and xCode instance the same
  • Previous by thread: Safe Signal Handling from the Run Loop
  • Next by thread: Bindings Update with Drag-and-Drop [solved]
  • Index(es):
    • Date
    • Thread