• 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: Why Is NSLog a No-Op?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why Is NSLog a No-Op?


  • Subject: Re: Why Is NSLog a No-Op?
  • From: Jens Ayton <email@hidden>
  • Date: Sun, 20 Dec 2009 00:34:56 +0100

Not a solution to the problem, but…

On Dec 20, 2009, at 00:18, Thomas Wetmore wrote:
>
> When running or debugging the program all calls to NSLog in the command line project's code work, but all calls to NSLog from the static library code are no-ops.
>
> NSLog is a macro defined in NSObjCRuntime.h as ...
>
> FOUNDATION_EXPORT void NSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
> FOUNDATION_EXPORT void NSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0);

These are not macros, they're function declarations. FOUNDATION_EXPORT is equivalent to extern, and NS_FORMAT_FUNCTION is used to indicate (to some compilers) that warnings should be generated if the arguments don't match the format string.

In other words, you can treat this is if it were 'extern void NSLog(NSString *format, ...);' (or 'extern "C" void NSLog(NSString *format, ...);' in Objective-C++).


--
Jens Ayton

 _______________________________________________
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

References: 
 >Why Is NSLog a No-Op? (From: Thomas Wetmore <email@hidden>)

  • Prev by Date: Why Is NSLog a No-Op?
  • Next by Date: Re: Why Is NSLog a No-Op?
  • Previous by thread: Why Is NSLog a No-Op?
  • Next by thread: Re: Why Is NSLog a No-Op?
  • Index(es):
    • Date
    • Thread