crash reading archive
crash reading archive
- Subject: crash reading archive
- From: James Maxwell <email@hidden>
- Date: Sun, 5 Apr 2009 13:24:44 -0700
I'm trying to read a "default" configuration-type file when my app
loads. It's worked, on and off, for the last couple of days, but it's
just started complaining again. This is the code I'm using to load the
object. It seems pretty straightforward, so I can't figure out what's
up. I'm assuming it's trying to release a released object, but I can't
see it... Is there anything in the error log (bottom) that says
anything unusual? The following code is in my WindowControllerDidLoad:
NSString *filePath;
filePath = [[[[NSHomeDirectory()
stringByAppendingPathComponent:@"Library"]
stringByAppendingPathComponent:@"Application Support"]
stringByAppendingPathComponent:@"ManuScore"]
stringByAppendingPathComponent:@"DefaultHTMNetwork.MHTMData"];
NSFileManager *fileManager = [NSFileManager defaultManager];
if([fileManager fileExistsAtPath:filePath])
[self setLiveHTMNetwork:[NSKeyedUnarchiver
unarchiveObjectWithFile:filePath]];
else
{
[self setLiveHTMNetwork:[[HTMNetwork alloc] init]];
[[self liveHTMNetwork] configureSimpleTestNetwork];
}
// ... etc...
And it's saved automatically, at runtime, with the following:
- (void) saveNetworkState
{
NSString *filePath;
filePath = [[[[NSHomeDirectory()
stringByAppendingPathComponent:@"Library"]
stringByAppendingPathComponent:@"Application Support"]
stringByAppendingPathComponent:@"ManuScore"]
stringByAppendingPathComponent:@"DefaultHTMNetwork.MHTMData"];
[NSKeyedArchiver archiveRootObject:self toFile:filePath];
}
And the error:
Program received signal: “EXC_BAD_ACCESS”.
kill
quit
#0 0x9695a688 in objc_msgSend
#1 0x90efae4f in NSPopAutoreleasePool
#2 0x90f09e53 in _decodeObject
#3 0x90f4fa6b in +[NSKeyedUnarchiver unarchiveObjectWithFile:]
#4 0x00004496 in -[MyDocument windowControllerDidLoadNib:] at
MyDocument.m:285
#5 0x96d24d2b in -[NSWindowController _windowDidLoad]
#6 0x96cc2d0a in -[NSWindowController window]
#7 0x96cc2c0a in -[NSWindowController showWindow:]
#8 0x96cc2b4d in -[NSDocument showWindows]
#9 0x96cc0e14 in -[NSDocumentController
openUntitledDocumentAndDisplay:error:]
#10 0x96cc095f in -[NSDocumentController(NSInternal) _openUntitled]
#11 0x96cc07b1 in -[NSApplication _doOpenUntitled]
#12 0x96cbfe95 in -[NSApplication(NSAppleEventHandling) _handleAEOpen:]
#13 0x96cbf6bc in -[NSApplication(NSAppleEventHandling)
_handleCoreEvent:withReplyEvent:]
#14 0x90f2443f in -[NSAppleEventManager
dispatchRawAppleEvent:withRawReply:handlerRefCon:]
#15 0x90f2414f in _NSAppleEventManagerGenericHandler
#16 0x94648648 in aeDispatchAppleEvent
#17 0x9464857e in dispatchEventAndSendReply
#18 0x94648425 in aeProcessAppleEvent
#19 0x954049a5 in AEProcessAppleEvent
#20 0x96cbcf91 in _DPSNextEvent
#21 0x96cbc630 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#22 0x96cb566b in -[NSApplication run]
#23 0x96c828a4 in NSApplicationMain
#24 0x00004718 in main at main.m:14
_______________________________________________
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