One Quickie


Varargs in Objective-C (General->Random)
This processes a nil-terminated sequence of strings:
- (void) snorgWaffle: (NSString *) start, ... {

    va_list argList;
    va_start (argList, start);

    NSString *string = start;

    while (string != nil) {
        NSLog (@"Done did saw string '%@'", string);

        string = va_arg (argList, NSString *);
    }

    va_end (argList);

} // snorgWaffle
and can be called like
[self snorgWaffle:@"red", @"planet", @"zeitgeist", nil];



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com