• 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: newie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newie question


  • Subject: Re: newie question
  • From: Bryan Henry <email@hidden>
  • Date: Mon, 08 Dec 2008 20:35:07 -0500

Ah right. Just looked that up - I was wondering how to exclude the comma if there aren't any variable arguments, so that debugLog(@"some message") would still works.

http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/cpp/variadic-macros.html if other people are looking for more info. ## has a special meaning between a comma and a variable argument.

Thanks,
Bryan

On Dec 8, 2008, at 8:18 PM, Steve Checkoway wrote:

On Mon, Dec 08, 2008 at 09:21:07AM -0500, Bryan Henry wrote:
The macro, by the way, would be something like this:

// Debug-build logging macro
#ifdef DEBUG
 #define debugLog(format, ...) NSLog(format, __VA_ARGS__)
#else
 #define debugLog(format, ...)	// Nothing
#endif

You probably want #define debugLog(format, ...) NSLog((format), ## __VA_ARGS__)

--
Steve Checkoway


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


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
References: 
 >newie question (From: "Oscar Alejandro Alvarado Prieto" <email@hidden>)
 >RE: newie question (From: "Jon C. Munson II" <email@hidden>)
 >Re: newie question (From: Jean-Daniel Dupas <email@hidden>)
 >Re: newie question (From: Bryan Henry <email@hidden>)
 >Re: newie question (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: newie question
  • Next by Date: Re: Which SDK is recommended when doing both Mac and iPhone development?
  • Previous by thread: Re: newie question
  • Next by thread: Re: newie question
  • Index(es):
    • Date
    • Thread