• 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
Re: Cocoa Custom NSCell Binding Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Custom NSCell Binding Issue


  • Subject: Re: Cocoa Custom NSCell Binding Issue
  • From: Casey Fleser <email@hidden>
  • Date: Fri, 13 Jan 2006 09:51:17 -0600

I think you may need to add something like this to when in your NSCell to get the new value into your controller:

- (void) updateValue: (id) inValue
forBinding: (NSString *) inBinding
{
NSDictionary *bindingInfo = [self infoForBinding: inBinding];

if (bindingInfo != nil) {
NSString *observedPath = [bindingInfo objectForKey: NSObservedKeyPathKey];
id observedObj = [bindingInfo objectForKey: NSObservedObjectKey];


		if (observedPath != nil && observedObj != nil)
			[observedObj setValue: inValue forKeyPath: observedPath];
	}
}

Casey

On Jan 12, 2006, at 9:35 AM, Sean Willson wrote:

It sounds like your setObjectValue: method is being called, but is
your objectValue method? Which way round are they being called?


I have fully implemented the objectValue method conforming to the interface,
added some NSLog statements in there to see if it ever gets called and it
does not. Is there something special that I have to do to get this working.
How does the NSArrayController that is controlling the Object A references
and binding to the UI get notified that the componant has set a new value
that it needs to propigate down to Object A? That seems to be the part that
is missing. That's why I said that I tried firing the "will" and "did"
change notifications for objectValue but that didn't work. I know this has
to be something small but I can't seem to find any examples that show a
custom NSCell type element using Cocoa Bindings.

_______________________________________________ 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
  • Follow-Ups:
    • Re: Cocoa Custom NSCell Binding Issue
      • From: Sean Willson <email@hidden>
References: 
 >Re: Cocoa Custom NSCell Binding Issue (From: Hamish Allan <email@hidden>)
 >Re: Cocoa Custom NSCell Binding Issue (From: Sean Willson <email@hidden>)

  • Prev by Date: Re: Detecting a user click while in a lengthy task (mainthread)
  • Next by Date: Re: Saving an AppleScript that targets my own application
  • Previous by thread: Re: Cocoa Custom NSCell Binding Issue
  • Next by thread: Re: Cocoa Custom NSCell Binding Issue
  • Index(es):
    • Date
    • Thread