0
刪除後的UIViewController viewWillAppear中無法運行
我做的一個子層到一個UIViewController這樣爲什麼會子視圖是由上海華
- (IBAction)transactionListViewCameraBtn_Pressed:(id)sender {
if([NWTillHelper isDebug] == 1) {
NSLog(@"%s entered", __PRETTY_FUNCTION__);
}
self.capture = [[ZXCapture alloc] init];
self.capture.camera = self.capture.back;
self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
[self.view.layer addSublayer:self.capture.layer];
self.capture.delegate = self;
[self applyOrientation];
}
的問題是,當我刪除子我希望自己獨到的見解viewWillAppear中運行,但它不是。
我刪除這樣
[self.capture.layer removeFromSuperlayer];
的子層viewWillAppear中不應該當原始View再次出現運行?
如果不是我如何確保我在viewWillAppear中的代碼在我移除subLayer時運行?
當您轉到另一個控制器並再次返回時,「viewWillAppear」調用。但你只是刪除超級層,所以它不叫。 –
你可以這樣做..以2個按鈕開始並取消。開始將添加圖層,當點擊取消它將刪除圖層。 –