• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: *Still* Crashing Cross Development
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >*Still* Crashing Cross Development (From: Robert Clair <email@hidden>)
 >Re: *Still* Crashing Cross Development (From: John Stiles <email@hidden>)

  • Prev by Date: Re: running code when all notifications have been processed?
  • Next by Date: Re: When exactly does a fault get fired?
  • Previous by thread: Re: *Still* Crashing Cross Development
  • Next by thread: Re: *Still* Crashing Cross Development
  • Index(es):
    • Date
    • Thread