• 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: KVC broken in 10.4.4 on Intel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVC broken in 10.4.4 on Intel?


  • Subject: Re: KVC broken in 10.4.4 on Intel?
  • From: Jim Correia <email@hidden>
  • Date: Mon, 30 Jan 2006 11:39:25 -0500

On Jan 30, 2006, at 2:38 AM, Da Woon Jung wrote:

Also, why _not_ use setValue:forKey:?  Do you have any _set<key>
setters in your code?

No, I'm using takeValue:forKey because I'm still targeting 10.2 for ppc. An #ifdef would allow me to use setValue:forKey: for Intel compiles, but would using setValue:forKey: make a difference? I'm still looking for any documentation that says it would.

DW,

It appears that -setValue:forKey: works fine for scalar floats on Intel, but -takeValue:forKey: does not. (See sample code below.)

It seems like filing a bug and modifying your code would be prudent.

Jim

#import <Cocoa/Cocoa.h>

@interface MyObject : NSObject
{
}

- (void)setFloat:(float)value;

@end

@implementation MyObject

- (void)setFloat:(float)value
{
	NSLog(@"value = %.2f", value);
}

@end

int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
MyObject *object = [[MyObject alloc] init];
NSNumber *number = [NSNumber numberWithFloat: 2.145f];

[object setValue: number forKey: @"float"];
[object takeValue: number forKey: @"float"]; // causes garbage to be printed on Intel

[object release];
[pool release];
return 0;
}


_______________________________________________
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: KVC broken in 10.4.4 on Intel?
      • From: Da Woon Jung <email@hidden>
References: 
 >KVC broken in 10.4.4 on Intel? (From: Da Woon Jung <email@hidden>)
 >Re: KVC broken in 10.4.4 on Intel? (From: Shawn Erickson <email@hidden>)
 >Re: KVC broken in 10.4.4 on Intel? (From: Da Woon Jung <email@hidden>)
 >Re: KVC broken in 10.4.4 on Intel? (From: Scott Ellsworth <email@hidden>)
 >Re: KVC broken in 10.4.4 on Intel? (From: Da Woon Jung <email@hidden>)

  • Prev by Date: Re: Position of window on screen
  • Next by Date: Re: Fake NSMenu-like view
  • Previous by thread: Re: KVC broken in 10.4.4 on Intel?
  • Next by thread: Re: KVC broken in 10.4.4 on Intel?
  • Index(es):
    • Date
    • Thread