关于随机参数... 的几个代码段
2012-12-25 16:26
239 查看
void ShowInfo( id formatstring,...)
{
va_list arglist;
if (!formatstring)
return;
va_start(arglist, formatstring);
id outstring = [[[NSStringalloc]initWithFormat:formatstringarguments:arglist]autorelease];
va_end(arglist);
[ [HFInfoView sharedInstance]showInfo: outstring];
}
# define NSLog(formatstr,...) {\
NSString *outstring = [NSString stringWithFormat:(formatstr),##__VA_ARGS__];\
printf([outstring UTF8String]);\
}
#define HFAlert(fmt, ...) \
{\
UIAlertView *alert1 = [[[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:fmt,##__VA_ARGS__] delegate:nil cancelButtonTitle:@"确认"
otherButtonTitles:nil] autorelease];\
[alert1 show]; \
}
{
va_list arglist;
if (!formatstring)
return;
va_start(arglist, formatstring);
id outstring = [[[NSStringalloc]initWithFormat:formatstringarguments:arglist]autorelease];
va_end(arglist);
[ [HFInfoView sharedInstance]showInfo: outstring];
}
# define NSLog(formatstr,...) {\
NSString *outstring = [NSString stringWithFormat:(formatstr),##__VA_ARGS__];\
printf([outstring UTF8String]);\
}
#define HFAlert(fmt, ...) \
{\
UIAlertView *alert1 = [[[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:fmt,##__VA_ARGS__] delegate:nil cancelButtonTitle:@"确认"
otherButtonTitles:nil] autorelease];\
[alert1 show]; \
}
相关文章推荐
- 关于servlet的工作原理和生命周期 和几个参数的使用范围
- JVM中关于内存的几个重要参数
- Spark2.0机器学习系列之6:GBDT(梯度提升决策树)、GBDT与随机森林差异、参数调试及Scikit代码分析
- 关于winmain的几个参数
- 关于jvm几个关键内存配置参数
- 关于微信支付参数[签名]字段-Java代码片段
- 关于sap的Logon的几个参数
- 关于C51的中断函数要注意的几个问题 -----中断中调用函数参数错误问题
- 关于单片机程序初始化硬件参数代码
- 关于向后台请求数据(get请求,无参数传递),返回html代码(实际需要返回的是json数据)的解决方案
- Spark2.0机器学习系列之5:GBDT(梯度提升决策树)、GBDT与随机森林差异、参数调试及Scikit代码分析
- 关于sap的Logon的几个参数
- 关于wordpress用户系统的几个代码小片段
- jena中关于本体操作的几个代码。(自己看的笔记)
- Android常用的几个系统参数相关代码片段
- 关于sap的Logon的几个参数
- 关于 git reset 命令几个常用参数的理解
- 几个关于随机数组产生的函数 包括各类可重复或不重复
- 关于sap的Logon的几个参数
- 关于STL中几个比较费解的参数类型