函数参数

#define showAlert(format, ...) myShowAlert(__LINE__, (char *)__FUNCTION__, format, ##__VA_ARGS__)


// Simple Alert Utility

void myShowAlert(int line,char *functname, id formatstring,...)

{    

va_list arglist;

if (!formatstring)return;

va_start(arglist, formatstring);

id outstring = [[[NSStringalloc] initWithFormat:formatstringarguments:arglist] autorelease];

va_end(arglist);

NSString *filename = [[NSStringstringWithCString:__FILE__ encoding:NSUTF8StringEncoding]lastPathComponent];

NSString *debugInfo = [NSStringstringWithFormat:@"%@:%d\n%s", filename, line, functname];

    

   UIAlertView *av = [[[UIAlertViewalloc] initWithTitle:outstringmessage:debugInfo delegate:nilcancelButtonTitle:@"OK"otherButtonTitles:nil]autorelease];

[avshow];

}



http://www.cnblogs.com/rainduck/archive/2010/11/10/1873417.html

你可能感兴趣的:(function,list,File,encoding,2010)