2012年6月26日
摘要: NSNotification的简单使用流程(例子)如下:1、在viewDidLoad添加:- (void)viewDidLoad{//添加如下 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAlertView:) name:@"showAlertView" object:nil];}2、.m文件中添加:(例子如下)- (void)showAlert:(NSString *)msg{ UIAlertView *alert = [[UIAlertView alloc] 阅读全文
posted @ 2012-06-26 10:41 tx天翔 阅读(2966) 评论(0) 推荐(0) 编辑
摘要: 1、@selector(showAlertView:)——带冒号的,表示带参数。其行为对应如下形式:-(void)showAlertView:(id)sender{}2、@selector(showAlertView)——没有冒号,表示无参数。其行为对应如下形式:-(void)showAlertView{} 阅读全文
posted @ 2012-06-26 10:31 tx天翔 阅读(215) 评论(0) 推荐(0) 编辑