Re: NSLog preventing a crash?
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