• 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
Using the debugger with local variables was Re: is this badly written code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using the debugger with local variables was Re: is this badly written code?


  • Subject: Using the debugger with local variables was Re: is this badly written code?
  • From: Erik Buck <email@hidden>
  • Date: Tue, 15 Apr 2008 10:46:48 -0700 (PDT)

>1) Write each portion of the code by assigning to intermediate ivars.
>This of course is easiest if you just type them in-line as you write
>them, but then of course they will not show up in the debugger so it
> is better to go ahead and type them in the @interface section.

Say what ?  Local variables show up perfectly fine in the debugger.  Creating an instance variable just to store intermediate results is of dubious value.

Even with nested messages, no special magic is needed.  To see intermediate values, just use the po command.

> po [NSURL URLWithString:@"somestring"]
> po [NSURLRequest requestWithURL:[NSURL URLWithString: @"somestring"]]

I also highly recommend F-Script for this type of interactive testing/debugging: http://www.fscript.org/

_______________________________________________

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

  • Follow-Ups:
    • Re: Using the debugger with local variables was Re: is this badly written code?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Capture mouse events globally
  • Next by Date: Re: App fails to kill NSTask processes
  • Previous by thread: Re: to write to file except NSData*
  • Next by thread: Re: Using the debugger with local variables was Re: is this badly written code?
  • Index(es):
    • Date
    • Thread