Variable argument lists
Variable argument lists
- Subject: Variable argument lists
- From: Ken Tozier <email@hidden>
- Date: Sat, 22 May 2004 03:22:20 -0400
I'm writing a class and would like to include an initialization method
like this one from NSDictionary:
+ (id) dictionaryWithObjectsAndKeys:(id) inFirst, ...
But I'm not really sure how to go about it. Could someone show me what
to do once I'm inside the initialization method?
+ (id) newFoo:(id) inFirst, ...
{
return [[[Foo alloc]
// is this the way to pass the arguments to the init method?
initFoo: inFirst]
autorelease];
}
- (id) initFoo:(id) inFirst, ...
{
self = [super init];
if (self)
{
// assuming I want to loop through the arguments
// what should go here?
}
}
Thanks,
Ken
_______________________________________________
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.