美文网首页iOS学习笔记
页面传值black方法

页面传值black方法

作者: 金牛忘忧 | 来源:发表于2016-06-26 15:45 被阅读0次

#import<UIKit/UIKit.h>

@interfaceViewController :UIViewController

@property(weak,nonatomic)IBOutletUILabel*label1;

@end

//

//ViewController.m

//页面传值black方法1

#import"ViewController.h"

#import"BaesViewController.h"

@interfaceViewController()

@end

@implementationViewController

- (void)viewDidLoad {

[superviewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

}

- (IBAction)buttonAction1:(UIButton*)sender {

BaesViewController*baesCtr = [[BaesViewControlleralloc]init];

baesCtr.sdf=^(NSString*xc){

self.label1.text= xc;

};

[selfpresentViewController:baesCtranimated:YEScompletion:^{

}];

}

@end

//

//BaesViewController.h

//页面传值black方法1

//

#import<UIKit/UIKit.h>

typedefvoid(^trandf)(NSString*);

@interfaceBaesViewController :UIViewController

@property(copy,nonatomic)trandfsdf;

@property(weak,nonatomic)IBOutletUITextField*text1;

@end

//

//BaesViewController.m

//页面传值black方法1

//

#import"BaesViewController.h"

@interfaceBaesViewController()

@end

@implementationBaesViewController

- (void)viewDidLoad {

[superviewDidLoad];

// Do any additional setup after loading the view from its nib.

}

- (IBAction)buttonAction2:(UIButton*)sender {

[selfdismissViewControllerAnimated:YEScompletion:^{

//self.sdf(_text1.text);

}];

_sdf(_text1.text);

}

@end

相关文章

  • 页面传值black方法

    #import @interfaceViewController :UIViewController @prope...

  • iOS 传值

    页面传值 NSNotification Delegate Block 单例 一、 页面传值 最简单直接的传值方法 ...

  • 参数绑定与传值

    参数绑定与传值1)功能方法之间的跳转2)功能方法之间的传值3)方法和页面之间传值(重点)4)从页面到功能方法(V-...

  • web前端开发中遇到的问题整理记录——2019-05

    目录 小程序中,子页面传值给父页面的方法 正文 1. 小程序中,子页面传值给父页面的方法 A 使用全局数据存储将要...

  • 2016-05-13(页面间传值)

    A页面push到B页面,如果要将A页面的值传递到B页面,最简单的方法就是使用属性传值。使用属性传值需要注意以下几点...

  • Xamarin Android 页面间传值方法:

    Xamarin Android 页面间传值方法: 父页面: Intent intent = new Intent(...

  • 代理

    不同页面间传值是必不可少,传值的方式有很多(方法传值,属性传值,代理传值,单例传值) ,这里主要总结下属性传值和代...

  • 页面传参的常见方法

    方法1,路由传值 页面A 传值给页面B页面A: 将id,name 通过路由方式传给下一个页面 键值对:由键名和键值...

  • iOS页面间逆传值

    页面间传值有两种: 正向传值(利用属性传值就可以了,很简单) 逆向传值(有3种常用的方法) 代理传值 block传...

  • 2019-01-03 动态路由配置及get取值

    一个页面跳转到另外一个页面进行传值方法: a).动态路由 b).get传值 c).localstorage 1.动...

网友评论

    本文标题:页面传值black方法

    本文链接:https://www.haomeiwen.com/subject/blaadttx.html