• 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: NSLog preventing a crash?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog preventing a crash?


  • Subject: Re: NSLog preventing a crash?
  • From: Rob Chahin <email@hidden>
  • Date: Tue, 24 Jul 2007 09:45:27 +0100

The crash was caused by me, in my infinite wisdom, adding 'dictionaries' to my 'array' without sending -copy to them. Especially idiotic as I do the exact same thing properly elsewhere in the code.

I guess NSLog sending -description must have fiddled with the retain count just enough to stop the crash.

- R


I have an NSObject subclass that acts like a wrapper for an NSArray of another NSObject subclass that wraps an NSDictionary.

Normally, my app crashes if I try to access one of these dictionaries twice in a row. However, if I call:

NSLog(@"%@", [arrayWrapper methodThatJustReturnsArray]);

between the 2 attempts, the code works fine. If I call that method but do nothing with it, i.e. removing the NSLog, the crash still occurs.

Without getting into the details of the code (for time's sake), is there any obvious reason why this would prevent a crash from occuring? I, for one, am confused.

- R

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSLog preventing a crash?
      • From: Shawn Erickson <email@hidden>
    • Re: NSLog preventing a crash?
      • From: Alastair Houghton <email@hidden>
References: 
 >NSLog preventing a crash? (From: Rob Chahin <email@hidden>)

  • Prev by Date: RE: How to get custom widgets into nib file window ?
  • Next by Date: Re: NSLog preventing a crash?
  • Previous by thread: Re: NSLog preventing a crash?
  • Next by thread: Re: NSLog preventing a crash?
  • Index(es):
    • Date
    • Thread