5
我有一個子視圖視圖2,在那裏我有有火災的動作soSomething一個UIButton按鈕廠景:如何創建自定義事件?
view1
--view2
----IBOutlet UIButton *button
-----(IBAction) doSomethingid)sender
點擊按鈕調用DoSomething的。 現在我該如何在doSomething中調度一個自定義事件並在view1中捕獲它?
例如,在視圖2:
代碼:
-(IBAction)doSomething:(id)sender{
// Disptach the event for the parent "superView" to receive
}
然後在廠景有什麼事情,處理該事件。