• 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: va_end() & [NSString initWithFormat:arguments:]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: va_end() & [NSString initWithFormat:arguments:]


  • Subject: Re: va_end() & [NSString initWithFormat:arguments:]
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 29 Apr 2010 21:49:50 -0500

On Apr 29, 2010, at 9:44 PM, Patrick M. Rutkowski wrote:

> Do I have to do a va_end() after using -[NSString initWithFormat:arguments:]?

If you call va_start(), you need to call va_end().  From the stdarg(3) man page:

"Note that each call to va_start() must be matched by a call to va_end(), from within the same function."

Note especially that last part.  These aren't actually functions, they're macros.  They can do funky things and the scope where they're invoked matters.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: va_end() & [NSString initWithFormat:arguments:]
      • From: "Patrick M. Rutkowski" <email@hidden>
References: 
 >va_end() & [NSString initWithFormat:arguments:] (From: "Patrick M. Rutkowski" <email@hidden>)

  • Prev by Date: va_end() & [NSString initWithFormat:arguments:]
  • Next by Date: Re: Getting a bezier path for a character
  • Previous by thread: va_end() & [NSString initWithFormat:arguments:]
  • Next by thread: Re: va_end() & [NSString initWithFormat:arguments:]
  • Index(es):
    • Date
    • Thread