#import// block格式: 返回值(^block名字)(參數(shù))
// (1)定義block
typedef void(^myBlcok)(NSArray *array);
@interface ZQResignVC : UIViewController
// (2)申明block屬性
@property (strong, nonatomic) myBlcok block;
@end
// 用block存儲值
@implementation ZQResignVC
NSArray *array=[[NSArray alloc]initWithObjects:_userNameText.text,_passWordText.text ,nil];
if (self.block)
{
?self.block(array);
}
// 拿到block的值
ZQResignVC *resignVC=[[ZQResignVC alloc]init];
//直接
resignVC.block=^(NSArray *array){
_userNameText.text=array[0];
_passWordText.text=array[1];
};