代理传值
来源:互联网 发布:铅笔袋淘宝 编辑:程序博客网 时间:2024/06/11 05:56
1、在ViewController.h里
#import "ViewController.h"#import "DelegateViewController.h"@interface ViewController ()<meDelegateViewController>@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; UIButton *btn=[[UIButton alloc]init]; btn.frame = CGRectMake(100, 200, 120, 50); btn.backgroundColor=[UIColor blueColor]; [btn setTitle:@"代理传值" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn];}-(void)btnClick{ DelegateViewController * delegateVC = [[DelegateViewController alloc] init]; delegateVC.delegate = self; [self.navigationController pushViewController:delegateVC animated:YES];}#pragma 代理方法-(void)delegateClick:(NSString *)meStr{ NSLog(@"我是获值方,此方法是在传值方触发 == %@",meStr);}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
0 0
- 代理传值
- 代理传值
- 代理传值
- ios 代理传值
- iOS 代理传值
- 代理传值
- 代理传值
- 代理传值
- swift代理传值
- iOS代理传值
- 代理传值
- iOS 代理传值
- iOS 代理传值
- 代理反向传值
- 代理传值
- IOS--代理传值
- ios代理传值
- 代理传值
- ibatis源码学习(三)参数和结果的映射原理
- java版本,servlet版本不对时
- MVP前奏(二)MVC在Android的小短腿
- Jsp9个内置对象详解
- @Autowired注入static 接口问题
- 代理传值
- 菜鸟学SSH之Struts2的配置
- HTTP返回值
- linux内核数据结构之链表
- ibatis源码学习(四)动态SQL的实现原理
- CString 百度百科
- http 请求 详解 3
- C++指针加整数、两个指针相减的问题
- 快速排序小规模数据