Re: Why Is NSLog a No-Op?
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