• 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: EXC_BAD_ACCESS in an strange place
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_ACCESS in an strange place


  • Subject: Re: EXC_BAD_ACCESS in an strange place
  • From: Chris Ridd <email@hidden>
  • Date: Fri, 23 Aug 2002 13:25:46 +0100

Clark Mueller <email@hidden> wrote:
> Hello everyone,
>
> I have an interesting problem with some code that really just doesn't
> want to play right. The following chunk of code triggers an
> EXC_BAD_ACCESS right at the line that calls [files count].
>
>> if( files == nil ){
>> RunAlertPanel(@"Sorry, the operation can't continue.");
>> return;
>> }
>>
>> if( [files count] < 1 ){ // <<--- EXC_BAD_ACCESS happens here
>> RunAlertPanel(@"The folder is empty.");
>> return;
>> }
>
> Some background info, first. "files" is an NSArray declared as a class
> variable, accessible to this code. It does get initialized, and even if
> it didn't, this is the weird part... A crash of this type would make me
> believe that "files" is not initialized, and calling "count" on an
> unallocated object causes the crash. But why doesn't the line right
> above, to check for whether files is initialized catch that and tell me?

Perhaps the files object has been released prior to you sending it the
count message.

Cheers,

Chris
_______________________________________________
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.

References: 
 >EXC_BAD_ACCESS in an strange place (From: Clark Mueller <email@hidden>)

  • Prev by Date: Sherlock 3
  • Next by Date: Re: Classes vs. custom palettes
  • Previous by thread: EXC_BAD_ACCESS in an strange place
  • Next by thread: Re: EXC_BAD_ACCESS in an strange place
  • Index(es):
    • Date
    • Thread