现在的位置: 首页 > 综合 > 正文

分享一个显示Alert的宏,以后弹对话框只要一句话就OK 了

2013年08月18日 ⁄ 综合 ⁄ 共 722字 ⁄ 字号 评论关闭
============================================================
博文原创,转载请声明出处
电子咖啡(原id蓝岩)
============================================================

分享一个显示Alert的宏,以后弹对话框只要一句话就OK 了,不多说,上代码

//
// simplify the UIAlertView using
//
#define Alert(messageId) \
{\
UIAlertView * alert = [[UIAlertView alloc]\
                        initWithTitle:nil\
                        message:[Resource getUIStringForKey:messageId inFile:nil]\
                        delegate:nil\
                        cancelButtonTitle:[Resource getUIStringForKey:@"alert.ok" inFile:nil]\
                        otherButtonTitles:nil];\
\
[alert show];\
alert = nil;\
}\
\

#define Alert2(messageText) \
{\
UIAlertView * alert = [[UIAlertView alloc]\
                        initWithTitle:nil\
                        message:messageText\
                        delegate:nil\
                        cancelButtonTitle:[Resource getUIStringForKey:@"alert.ok" inFile:nil]\
                        otherButtonTitles:nil];\
\
[alert show];\
alert = nil;\
}\
\

抱歉!评论已关闭.