Re: Adding NSLog() changes behavior
Re: Adding NSLog() changes behavior
- Subject: Re: Adding NSLog() changes behavior
- From: Wade Tregaskis <email@hidden>
- Date: Wed, 17 Mar 2004 01:05:50 +1100
It's probably not your problem in this case, but it might be:
- (void)setImage:(NSImage*)newImage {
if ( image ) [image release];
image = [newImage retain];
What if newImage == image? You may have just deallocated it. Your
code should read something more like this:
if (image != newImage) {
[newImage retain];
[image release];
image = newImage;
// Do stuff
}
Since you're not seeing any crashing behaviour I doubt this is the
problem you're actually seeing, but hopefully now you'll be able to
avoid this particular bug in future.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.