• 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
Adding NSLog() changes behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Adding NSLog() changes behavior
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: Adding NSLog() changes behavior
      • From: Wade Tregaskis <email@hidden>
  • Prev by Date: Re: Binding options
  • Next by Date: Re: stopTracking in NSButtonCell
  • Previous by thread: Problem with the Keyboard Events in a window
  • Next by thread: Re: Adding NSLog() changes behavior
  • Index(es):
    • Date
    • Thread