ios 類方法block怎么回調函數
2 回答

喵喵時光機
TA貢獻1846條經驗 獲得超7個贊
我在viewDidLoad中斷點打印showDataLabel是這樣的
Printing description of self->_showDataLabel:
<UILabel: 0x7f86bb5b8cc0; frame = (134 98; 170 21); text = '我是第一個頁面的數據'; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7f86bb545b60>>
是有值的 .
在CCViewController中我把myblock聲明成屬性
回調寫在返回事件中
- (IBAction)backPageAction:(id)sender {
if (self.myblock) {
self.myblock(self.showDataLabel.text);
}
[self dismissViewControllerAnimated:YES completion:^{
}];
}
- 2 回答
- 0 關注
- 1079 瀏覽
添加回答
舉報
0/150
提交
取消