Re: Setting an NSColor crashes - probably very simple issue
Re: Setting an NSColor crashes - probably very simple issue
- Subject: Re: Setting an NSColor crashes - probably very simple issue
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 5 Feb 2008 00:27:18 -0800
On Feb 4, 2008, at 11:27 PM, Steve Cronin wrote:
I turned on NSZombieEnabled
[I went to executable - Get Info - Arguments - Variables to be set
Added NSZombieEnabled set value to YES (the docs sometimes say YES
and sometimes say 1...)
I've run it using both values... same result
I also checked the checkbox that has no explanation for its use but
appears to mean Use/Don'tUse
For good measure did a CleanAll and recompiled.
No change in output.....
#0 0x9282b36d in -[NSException raise]
#1 0x92852247 in +[NSException raise:format:]
#2 0x928da4ca in -[NSObject doesNotRecognizeSelector:]
#3 0x927fe32b in -[NSObject(NSForwardInvocation) forward::]
#4 0x90a5ccc1 in _objc_msgForward
#5 0x9082a215 in CFDataGetBytePtr
#6 0x928009d5 in -[NSUnarchiver initForReadingWithData:]
#7 0x92843e6f in +[NSUnarchiver unarchiveObjectWithData:]
#8 0x93514ceb in -[NSBinder
valueForBinding:resolveMarkersToPlaceholders:]
#9 0x93514c00 in -[NSValueBinder _referenceBindingValue]
#10 0x93514838 in -[NSValueBinder
_adjustObject:mode:observedController:observedKeyPath:context:editableState:adjustState
:]
#11 0x935144c2 in -[NSValueBinder
_observeValueForKeyPath:ofObject:context:]
#12 0x927e7324 in -[NSObject(NSKeyValueObserverNotification)
didChangeValueForKey:]
#13 0x0511eed4 in -[XYZController awakeFromNib] at
XYZWindowController.m:130
With same message cited earlier in console.
What have I not done correctly?
Huh -- that seems pretty bizarre.
Restoring some OP context:
@interface MyObject : NSObject { ... NSColor * myColor; ... }
... setters/getters deleted ...
Then:
- awakeFromNib {
.. [self setMyColor:[NSColor whiteColor]]; ..
}
Assuming for the moment that frame #13 in the above backtrace
corresponds to the -setMyColor: invocation in the -awakeFromNib method
(you'll want to confirm that in GDB), that particular backtrace would
seem to indicate that unarchiving is being attempted in response to a
didChangeValueForKey: KVO notification.
And *that* is most likely the result of having an NSUnarchiveFromData
value transformer on the associated binding. And that would also
explain the error message -- *** -[NSCachedWhiteColor bytes]:
selector not recognized -- in that the transformer is attempting to
unarchive an NSColor by treating it as an NSData.
A bit of a long shot, but do you possibly have an incorrect
NSUnarchiveFromData transformer on a binding that retrieves myColor?
b.bum
_______________________________________________
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