Re: *Still* Crashing Cross Development
Re: *Still* Crashing Cross Development
- Subject: Re: *Still* Crashing Cross Development
- From: Shaun Wexler <email@hidden>
- Date: Fri, 17 Feb 2006 15:36:16 -0800
On Feb 17, 2006, at 2:14 PM, John Stiles wrote:
Random guess--could it be that the NSDocumentController isn't ready
to be called yet? -init is pretty early in the app's lifetime and I
don't think it's a guarantee that the other objects are all alive
and kicking just yet.
You might want to postpone calling this until application finishes
launching or awakeFromNib or something like that.
It's fine to create the NSDocumentController immediately after +
[NSApplication sharedApplication] sets the NSApp global.
Program received signal EXC_BAD_ACCESS, Could not access memory.
0xfffeff00 in ?? ()
(gdb) where
#0 0xfffeff00 in ?? ()
Cannot access memory at address 0xfffeff00
Cannot access memory at address 0xfffeff00
#1 0x00044888 in -[ZGApplicationDelegate init] (self=0xd47c10,
_cmd=0x9086ed94) at /Users/rclair/Zeus/system/
ZGApplicationDelegate.m:71
#2 0x92f6bd80 in -[NSCustomObject nibInstantiate] ()
#3 0x92e9af38 in -[NSIBObjectData instantiateObject:] ()
#4 0x92ea1f64 in -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:] ()
#5 0x92f93d04 in loadNib ()
#6 0x92eeaf28 in +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] ()
#7 0x92f69e00 in +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] ()
#8 0x92f7b5f4 in +[NSBundle(NSNibLoading) loadNibNamed:owner:] ()
#9 0x92f69c68 in NSApplicationMain ()
#10 0x000447ec in main (argc=1, argv=0xbffffb40) at /Users/rclair/
Zeus/system/main.m:28
the bit of code it's executing is:
- (id) init
{
[super init];
if (self)
{
--------> documentController = [NSDocumentController
sharedDocumentController];
There's the problem. If you DON'T reassign self ($r3), and -[super
init] returns nil because it freed the object's memory @ *self, then
the "self" pointer is invalid. Follow the rules and ye shall
succeed... ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
"Intellectuals solve problems, geniuses prevent them." - Albert Einstein
_______________________________________________
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