block回调

//

//  SecondViewController.h

//  Block高级

//

//  Created by 李洪鹏 on 15/7/15.

//  Copyright (c) 2015 李洪鹏. All rights reserved.

//

 

#import <UIKit/UIKit.h>

 

 

//声明block

typedef void(^ReturnTextBlock)(NSString *showText);

 

@interface SecondViewController : UIViewController

 

 

//声明block的属性

@property (nonatomic,copy)ReturnTextBlock  returnTextBlock;

 

 

//声明block的方法

- (void)returnText:(ReturnTextBlock)block;

 

@end

 

 

// 调用block

    _returnTextBlock(_secondView.NametextField.text);

    [self.navigationController popViewControllerAnimated:YES];

 

原文地址:https://www.cnblogs.com/lhp-1992/p/4702380.html