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

NSLog a No-Op Probably Explained


  • Subject: NSLog a No-Op Probably Explained
  • From: Thomas Wetmore <email@hidden>
  • Date: Sun, 20 Dec 2009 00:18:09 -0500

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

  • Follow-Ups:
    • Re: NSLog a No-Op Probably Explained
      • From: Tom Davie <email@hidden>
  • Prev by Date: Re: Awful function pointer conversion function template
  • Next by Date: Re: NSLog a No-Op Probably Explained
  • Previous by thread: Re: Why Is NSLog a No-Op?
  • Next by thread: Re: NSLog a No-Op Probably Explained
  • Index(es):
    • Date
    • Thread