UIAlertView - 弹出框

UIAlertView 继承于UIView

初始化方法:- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /* <UIAlertViewDelegate>*/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles,...,nil;  初始化方法创建一个弹出框对象,指定标题(title)、显示的文字(message)、委托对象(一般指的是当前的师徒控制器self,所以当前视图控制器需要遵守UIAlertViewdelegate,并实现响应的协议方法),取消按钮的标题(cancelButtonTitle)、其他按钮的标题(多个的话使用逗号隔开,以nil结尾,同时存在三个以上按钮时纵向排列)

属性:

@property(nonatomic,assign) id /*<UIAlertViewDelegate>*/delegate; //委托对象

@property(nonatomic,copy) NSString *title;                                      //标题文件

@property(nonatomic,copy) NSString *message;                //显示的消息文本信息

@property(nonatomic,readonly) NSInteger numberOfBUtton;      //弹出框中按钮的个数

@property(nonatomic) NSInteger cancelButtonIndex;                        //

posted on 2015-05-09 22:01  王桂敏  阅读(194)  评论(0编辑  收藏  举报

导航