我一直在尝试使用块数据传递回用块而不是委托
数据在secondViewController .h文件中
@property (nonatomic, copy)void(^myBlock)(NSString *);
呼叫发送的数据落后
声明块传递块无论你需要从.m文件传递数据secondViewController
myBlock(@"this will displayed in firstViewController");
3.进口在firstViewController .m文件.h文件中上方,并定义块作为
secondViewController *ref =[[secondViewController alloc ]init];
ref.myBlock =^void(NSString *data)
{
self.labelOffirstviewcontroller=data;
};
同时运行时我得到EXC坏访问错误谁能排序的问题呢?
你在错误的方式定义关闭。我们没有定义关闭属性 – Wolverine
然后你可以解释如何定义它? @Wolverine –
typealias ClosureType =(ParameterTypes) - >(ReturnType) – Wolverine