FYI: Bug with archived NSShadow objects
FYI: Bug with archived NSShadow objects
- Subject: FYI: Bug with archived NSShadow objects
- From: Ricky Sharp <email@hidden>
- Date: Tue, 07 Dec 2004 11:20:13 -0600
I just filed the following bug:
<rdar://3908770>
I've found that under Mac OS X 10.3.6 (I haven't had the chance to explore other versions), that the x-offset value of an NSShadow is either not being decoded correctly. When decoding, you always get a value of 0. It could be the case where the encoding side of things is at fault though.
A workaround involves not coding/decoding the NSShadow directly (which should have worked since it conforms to NSCoding). Instead, code/decode the individual attributes.
So instead of:
[coder encodeObject:[self textShadow] forKey:@"MyTextShadow"];
you'd use:
NSShadow* theTextShadow = [self textShadow];
[coder encodeObject:[theTextShadow shadowColor] forKey:@"MyTextShadowColor"];
[coder encodeFloat:[theTextShadow shadowBlurRadius] forKey:@"MyTextShadowBlurRadius"];
[coder encodeFloat:[theTextShadow shadowOffset].width forKey:@"MyTextShadowXOffset"];
[coder encodeFloat:[theTextShadow shadowOffset].height forKey:@"MyTextShadowYOffset];
You'd do something similar when decoding.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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