Adding NSLog() changes behavior
Adding NSLog() changes behavior
- Subject: Adding NSLog() changes behavior
- From: Michael Becker <email@hidden>
- Date: Tue, 16 Mar 2004 14:56:40 +0100
Hello all!
Something really weird was going on with my application, and I wonder
if anybody might have a clue what :-)
I have a custom NSView that displays a picture. Therefore it has a
-setImage: method. In this method nothing big happens:
- (void)setImage:(NSImage*)newImage {
if ( image ) [image release];
image = [newImage retain];
mouseDragging = NO;
[ self setFrameSize:[image size]];
NSLog(@"%@", image);
[ self display];
}
If I comment or leave out the NSLog(), the view doesn't show anything.
It's plain white (although I don't even use a white color in my
project). When I take the NSLog back in, everything works nicely.
I solved this issue by putting a [ self
setFrameOrigin:NSMakePoint(0,0)]; after the -setFrameSize:... the error
seems to be gone (although I am not even sure why). But I still wonder
how NSLog would affect THIS part of the application?
Or am I just seeing coincidental ghosts? :-)
Bye,
Michael
_______________________________________________
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.