• 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
Re: NSLog a No-Op Probably Explained
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog a No-Op Probably Explained


  • Subject: Re: NSLog a No-Op Probably Explained
  • From: Tom Davie <email@hidden>
  • Date: Sun, 20 Dec 2009 08:51:08 +0000

I'm sorry, but you're explanation does not make sense in a C like language setting.

A C like language uses eval/apply semantics – i.e. a function's arguments are evaluated before the function is applied.  With this in mind, the arguments to NSLog are evaluated in an environment that knows nothing about them being arguments, let alone what they're arguments to.

Bob

On Sun, Dec 20, 2009 at 5:18 AM, Thomas Wetmore <email@hidden> wrote:
Xcoders,

My previous request held incorrect info. NSLog is not a macro, so it can't be compiled out. Red herring based on ignorance, nay to be honest, stupidity.

After another hour of experimentation I believe I have the explanation of why some of my calls to NSLog do not print anything. If this is a well-known phenomenon I apologize.

It appears that NSLog does not allow "recursive" calls, that is, if you call NSLog and the evaluation of one of its arguments ALSO causes calls NSLog, the deeper calls are essentially ignored. I don't know how to prove this definitively but it is the case that the deeper calls to NSLog do indeed call dyld_stub_NSLog, but instead of dyld_stub_NSLog doing anything real, it returns immediately.

(I had NSLog calls inside a class's description method; these calls did not work when the description method was called within the context of another NSLog. However, when the description method is called outside the context of an NSLog call the NSlog calls in the description method work fine.)

My great inexperience with Mac OS X development is a poor excuse, but I don't know yet how to single step within the assembly code of system framework code, else I believe I could prove this.

Tom Wetmore, Chief Bottle Washer, DeadEnds Software _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSLog a No-Op Probably Explained
      • From: Ken Thomases <email@hidden>
References: 
 >NSLog a No-Op Probably Explained (From: Thomas Wetmore <email@hidden>)

  • Prev by Date: NSLog a No-Op Probably Explained
  • Next by Date: Re: NSLog a No-Op Probably Explained
  • Previous by thread: NSLog a No-Op Probably Explained
  • Next by thread: Re: NSLog a No-Op Probably Explained
  • Index(es):
    • Date
    • Thread