• 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: [SOLVED] Crash when creating instance of class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] Crash when creating instance of class


  • Subject: Re: [SOLVED] Crash when creating instance of class
  • From: Jason Bell <email@hidden>
  • Date: Tue, 23 Nov 2004 14:20:26 -0500

Another example of what can happen after several long nights working on an overdue project.

If anyone is curious, this is what will happen if you try to instantiate a class when you've excluded the definition of its superclass from the target. Oops.

- Jason


On Nov 23, 2004, at 12:35 PM, Jason Bell wrote:

I've been doing Cocoa development for quite a while now and for the first time, I've encountered a problem where I have absolutely no clue what to even try next.

My application crashes with an EXC_BAD_ACCESS when attempting to create an instance of one of my classes. Specifically, the problem occurs in this code:

AIPerson *person;
person = [[AIPerson alloc] init];

Pretty simple, right? We all do it millions of times. Well, the second line produces a crash log with this:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000010

Thread 0 Crashed:
0 libobjc.A.dylib 0x9083293c class_initialize + 0x9c
1 libobjc.A.dylib 0x9083294c class_initialize + 0xac
2 libobjc.A.dylib 0x90831524 _class_lookupMethodAndLoadCache + 0x84
3 libobjc.A.dylib 0x90831298 objc_msgSend + 0xb8
......


It doesn't even get to the init method. I don't have my own +(void)initialize method and if I add one, it doesn't get run either. I've tried a clean-rebuild and even deleting the entire build folder. Since I get no compile-time errors or warnings and this log is all I have to go on, I'm at a bit of a loss.

Seems strange, I know. I just can't think of a way to make this happen even if I wanted it to. Any suggestions?

- Jason Bell


_______________________________________________ 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: 
 >Crash when creating instance of class (From: Jason Bell <email@hidden>)

  • Prev by Date: Re: Button doesn't respond in a modal sheet created from window NIB
  • Next by Date: Re: Crash when creating instance of class
  • Previous by thread: Re: Crash when creating instance of class
  • Next by thread: Button doesn't respond in a modal sheet created from window NIB
  • Index(es):
    • Date
    • Thread