[Q] Why unsolicited dealloc in NSKeyedUnarchiver?
[Q] Why unsolicited dealloc in NSKeyedUnarchiver?
- Subject: [Q] Why unsolicited dealloc in NSKeyedUnarchiver?
- From: "Peter.Teeson" <email@hidden>
- Date: Mon, 19 Apr 2004 22:35:33 -0400
In trying to add Open Recent support to MyDocument app everything is
working fine with the exception of an unsolicited call to dealloc by
NSKeyedUnarchiver. Any ideas where this is coming from and moreover
why? I'm confused. TIA for your help... Peter
From MyDocument
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType {
passwordRecords = [NSKeyedUnarchiver unarchiveObjectWith
Data:data];
return YES;
}
From PasswordsDataSource designated initializer
-(id)initWithCoder:(NSCoder *)coder {
self = [super init];
passwordRecs = [[NSMutableArray alloc] init];
[self addPasswordRecord];
if ([coder allowsKeyedCoding]) {
passwordRecs = [coder decodeObjectForKey:@"passwordRecs"];
}
return self;
}
From PasswordRecord designated initializer
-(id)initWithCoder:(NSCoder *)coder {
if (self = [super init]) {
[self setClientID:@"Replace me"];
[self setCreatedTS:[NSCalendarDate calendarDate]]; // Now
[self setMACAddress:@"01-23-45-67-89-AB"];
[self setPassword:@"replace it"];
}
if ([coder allowsKeyedCoding]) {
[self setClientID:[coder decodeObjectForKey:@"clientID"]];
[self setCreatedTS:[coder decodeObjectForKey:@"createdTS"]];
[self setMACAddress:[coder decodeObjectForKey:@"macAddress"]];
[self setPassword:[coder decodeObjectForKey:@"password"]];
}
return self;
}
From debugger
#0 0x020e8450 in -[PasswordRecord dealloc] at PasswordRecordsModel.m:88
#1 0x90197fe8 in CFDictionaryRemoveAllValues
#2 0x901a6088 in __CFDictionaryDeallocate
#3 0x90190db0 in CFRelease
#4 0x90a5545c in -[NSKeyedUnarchiver dealloc] <<<<<<<<<
unsolicited call which is breaking my code....
#5 0x90aacf3c in +[NSKeyedUnarchiver unarchiveObjectWithData:]
#6 0x02009348 in -[MyDocument loadDataRepresentation:ofType:] at
MyDocument.m:52
#7 0x930522f8 in -[NSDocument loadFileWrapperRepresentation:ofType:]
#8 0x9305261c in -[NSDocument readFromFile:ofType:]
#9 0x92f69fb0 in -[NSDocument initWithContentsOfFile:ofType:]
#10 0x92f69e24 in -[NSDocumentController
makeDocumentWithContentsOfFile:ofType:]
#11 0x92f69c64 in -[NSDocumentController _openDocumentFileAt:display:]
#12 0x92fb3b4c in -[NSDocumentController _openFile:]
#13 0x92fa5740 in -[NSApplication _doOpenFile:ok:tryTemp:]
#14 0x92fec4ec in -[NSApplication openFile:ok:]
#15 0x93054188 in -[NSDocumentController _openRecentDocument:]
#16 0x92e77ac0 in -[NSApplication sendAction:to:from:]
#17 0x92ead30c in -[NSMenu performActionForItemAtIndex:]
#18 0x92ef1c2c in -[NSCarbonMenuImpl
performActionWithHighlightingForItemAtIndex:]
#19 0x92e2ee08 in _NSHandleCarbonMenuEvent
#20 0x92dd2d84 in _DPSNextEvent
#21 0x92de93b0 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#22 0x92dfd718 in -[NSApplication run]
#23 0x92eb9b80 in NSApplicationMain
#24 0x011bff74 in main at main.m:13
_______________________________________________
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.