Adding Spit and Polish to Your Cocoa App
Subject:   my zooming broke somewhere in devp't
Date:   2002-06-25 04:09:19
From:   michele
Response to: my zooming broke somewhere in devp't

Hello Paul,

You cannot use my code with Mike's code, it brings conflicts.

Otherwise, I tell you again (I think I've already done it) how you can see some outputs from your code.

Use NSLog.

The code for NSLog must be put after all variables' declarations, otherwise you'll get errors at compile time.

So, when you want to see what happens during willUsesStandardFrame, put inside the code something like this, assuming that myWindow is the window you want info from:

NSLog(@"Info about myWindow: %g, %g", [myWindow frame].size.width, [myWindow frame].size.height);

It gives you the width and size of the window at the time the runtime system calls this line of code.

You can put NSLog about what you want throughout your code. Very useful when you cannot access to info through the debugger, what happens with the window willuseStandardFrame because it is called repeatedly or when you invoke something like windowWillBecomeKey, because that debugger's window that becomes key.

For other types of methods, put breaks into your code with an NSLog like this:

NSLog(@"Enter myMethod");

so you can trace the code and run your app with debugger and then you will understand why mixing both codes (Mike's and mine) makes no sense.

Hope this helps.


1 to 3 of 3
  1. NSLog experiments #1
    2002-06-27 22:00:10  psheldon [View]

    • NSLog experiments #2
      2002-06-29 08:36:54  psheldon [View]

  2. recoded on top of Mike's code, strange zooming and dragging
    2002-06-27 14:56:13  psheldon [View]

  3. mixing code sense or no sense, thanks
    2002-06-26 22:23:38  psheldon [View]

1 to 3 of 3