我一直在嘗試使用塊數據傳遞迴用塊而不是委託
數據在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