• 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: key path blues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key path blues


  • Subject: Re: key path blues
  • From: Dave Sopchak <email@hidden>
  • Date: Thu, 1 Feb 2007 11:27:36 -0800

Hi Steve,
No, I had my setDwell function to only change the dwell value. I put in your below code and it had no effect.


Also, I don't put the willChangeValueForKey stuff in my top object and yet things work just fine in the text fields. Is this because of the NSObjectController attached to the top object is handling such things?

Thanks.

Dave

On Feb 1, 2007, at 11:10 AM, Stephen Deken wrote:

        [[self polCurve] setDwell:3.9];
        [self setValue:[NSNumber numberWithFloat:3.9]
forKeyPath:@"polCurve.dwell"];

These two methods do the exact same thing, so it's not surprising that they're both failing in the same way. What does your -[setDwell:] function look like? It should look something like this:

-(void) setDwell:(float)v
{
    [self willChangeValueForKey:@"dwell"];
    _dwell = v;
    [self didChangeValueForKey:@"dwell"];
}

If you leave off the will/didChangeValueForKey parts, KVO doesn't know
the value has changed and won't update any bound objects.

HTH,

--
Stephen Deken
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40comcast.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
    • Re: key path blues
      • From: Brian Smith <email@hidden>
References: 
 >key path blues (From: Dave Sopchak <email@hidden>)
 >Re: key path blues (From: "Stephen Deken" <email@hidden>)

  • Prev by Date: Re: key path blues
  • Next by Date: Re: Initializing Subclass of NSTextContainer
  • Previous by thread: Re: key path blues
  • Next by thread: Re: key path blues
  • Index(es):
    • Date
    • Thread