• 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: NSString array to -> char**
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString array to -> char**


  • Subject: Re: NSString array to -> char**
  • From: Seth Delackner <email@hidden>
  • Date: Sun, 16 Mar 2003 03:13:07 -0800

On Saturday, March 15, 2003, at 11:36 PM, Chris Ridd wrote:
You can go through the variable arguments again by calling va_start(varargs, arg1) right after calling va_end(varargs) the first time. Then your first loop can just increment a counter.

I have encapsulated the functionality in a class SDCStringArray with the important initializer:
-(id)initWithVarArgs:(NSString*) arg1, ...;

But then I realized that this class will be called by methods that themselves take variadic argument lists, so I tried

-(id)initWithVarArgs:(NSString*) arg1 {
va_list varargs;
va_start(varargs, arg1)
}

With the idea that va_start would somehow magically understand the impossible (that we should be looking at not our own set of parameters following arg1, but the set of parameters following arg1 in the parent function. So I can va_start a list in the caller, then pass the list, then close it after the method is done, but this is ugly and makes it impossible for the method to traverse the list twice.

Thanks for the advice thus far. Is there a solution to this part?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: NSString array to -> char** (From: Chris Ridd <email@hidden>)

  • Prev by Date: Retain counts with a dictionary
  • Next by Date: Re: Trouble with a save panel
  • Previous by thread: Re: NSString array to -> char**
  • Next by thread: Newbie question - Leak in NSDictionary
  • Index(es):
    • Date
    • Thread