Re: IB bug? - copyWithZone: selector not recognized
Re: IB bug? - copyWithZone: selector not recognized
- Subject: Re: IB bug? - copyWithZone: selector not recognized
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 28 Aug 2002 07:31:08 -0400
on 02-08-28 4:27 AM, Bill Cheeseman at email@hidden wrote:
>
I have in fact made these conversions, and
>
by golly I forgot to add retain calls.
Unfortunately, fixing the retain issues did not solve the
copyWithZone:-selector-not-recognized problem.
I sent Apple three stack traces. I can't include all of them here because
the list won't accept long messages, but I'll include the first. They seem
to be identical except where the error arises.
In one, the exception is apparently raised in NSNumberFormatter's
setMinimum: method while the nib file is being unarchived. In the second,
the exception is apparently raised in the setMaximum: method. In the third,
the exception is apparently raised in NSNumberFormatter's
setAttributedStringForNotANumber method. These differences appear to be
random, except that I did resave and rebuild in between resetting IB's
preferences in each case.
My nib file does have an NSNumberFormatter instantiated in the Instances tab
of the nib file. It is connected to a form field in a tab view item. The
error recurs no matter what numbers I place in the mimimum and maximum
fields in the Attributes pane of the NSNumberFormatter Info Panel, and even
if I leave them blank.
The problem goes away when I save the nib file as Pre-10.2. I WAS WRONG WHEN
I SAID IT ALSO GOES AWAY WHEN THE NIB FILE IS SAVED AS 10.2 FORMAT -- the
third stack trace was with the nib file saved as 10.2 format. The first two
stack traces were with the nib file saved as Both Formats. THIS SUGGESTS
THAT THE PROBLEM IS IN THE NEW KEYED ARCHIVING NIB UNARCHIVING CODE IN
COCOA, doesn't it? Or in the way IB is saving keyed archive nib files?
My document's makeWindowControllers method does this:
VRMainWindowController *controller =
[[VRMainWindowController alloc] init];
etc.
My VRMainWindowController's init method does this:
if (self = [super initWithWindowNibName:@"VRDocument"]) {
[self setShouldCloseDocument:YES];
// set some instance variables here
}
return self;
I am aware that NSFormatter's objectValue and setObjectValue: methods
require objects that conform to the NSCopying protocol. In my code, the
object in the form field with an NSNumberFormatter connected is an NSNumber
object, which does adopt NSCopying. Besides, the error message tells me that
the form itself is being sent a copyWithZone: message, not the value this
form field holds. NSForm objects don't conform to NSCopying, and they aren't
supposed to, are they?
I see that NSFormCell and NSCell do conform to NSCopying. My subclass of
NSForm declares three external static variables. But I don't subclass
NSFormCell, only NSForm, so I shouldn't have to add any NSCopying methods to
my NSForm subclass, should I?
I am at a loss. I don't know where to turn next.
2002-08-28 05:42:21.752 Vermont Recipes[3606] *** -[VRUndoableForm
copyWithZone:]: selector not recognized
(gdb) bt
#0 0x90844888 in -[NSException raise] ()
#1 0x90844810 in +[NSException raise:format:] ()
#2 0x907f0fd4 in -[NSObject(NSForwardInvocation) forward::] ()
#3 0x9068c130 in _objc_msgForward ()
#4 0x90840360 in -[NSNumberFormatter setMaximum:] ()
#5 0x9082d568 in -[NSNumberFormatter initWithCoder:] ()
#6 0x908103ec in _decodeObjectBinary ()
#7 0x908185d4 in _decodeObject ()
#8 0x93236b88 in -[NSNibConnector initWithCoder:] ()
#9 0x932374bc in -[NSNibOutletConnector initWithCoder:] ()
#10 0x908103ec in _decodeObjectBinary ()
#11 0x9083cb0c in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] ()
#12 0x907fcac8 in -[NSArray initWithCoder:] ()
#13 0x908103ec in _decodeObjectBinary ()
#14 0x908185d4 in _decodeObject ()
#15 0x931b9f10 in -[NSIBObjectData initWithCoder:] ()
#16 0x908103ec in _decodeObjectBinary ()
#17 0x908185d4 in _decodeObject ()
#18 0x93237f70 in -[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] ()
#19 0x93237c7c in +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] ()
#20 0x93237de8 in +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] ()
#21 0x933801ac in -[NSWindowController loadWindow] ()
#22 0x9337f918 in -[NSWindowController window] ()
#23 0x9337fbec in -[NSWindowController showWindow:] ()
#24 0x931625ec in -[NSDocument showWindows] ()
#25 0x93168bfc in -[NSDocumentController
openUntitledDocumentOfType:display:] ()
#26 0x93168e8c in -[NSDocumentController newDocument:] ()
#27 0x930cfe2c in -[NSApplication sendAction:to:from:] ()
#28 0x9320fd18 in -[NSMenu performActionForItemAtIndex:] ()
#29 0x9310a164 in -[NSCarbonMenuImpl
performActionWithHighlightingForItemAtIndex:] ()
#30 0x9308122c in _NSHandleCarbonMenuEvent ()
#31 0x930824d4 in _DPSNextEvent ()
#32 0x930ccf84 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#33 0x930ca500 in -[NSApplication run] ()
#34 0x930d2598 in NSApplicationMain ()
#35 0x000043f8 in main (argc=1, argv=0xbffffba8) at
main.m:5/Volumes/Master/Users/Shared/Vermont Recipes 20 10.2/
#36 0x00003554 in _start (argc=1, argv=0xbffffba8, envp=0xbffffbb0) at
/SourceCache/Csu/Csu-45/crt.c:267/SourceCache/Csu/Csu-45/
#37 0x000033d4 in start ()
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.