Block

2016-11-23  本文已影响0人  BlueSky520

A页面:

#import "AViewController.h"

@property(nonatomic, copy)void (^ClubCardViewModelBlock)(NSDictionary * dict);

#import "AViewController.m"

if (self.ClubCardViewModelBlock){

NSDictionary * dict = @{@"name":@"xvbobo",@"age":@"26"};     

self.ClubCardViewModelBlock (dict)

}

B页面:

#import "BViewController.m"

#import "AViewController.h"

AViewController * A = [[AViewController alloc] init];

A.ClubCardViewModelBlock = ^(NSDictionary * dict){

  NSLog(@"%@",dict);

}

上一篇下一篇

猜你喜欢

热点阅读