UIView의 removeFromSuperview
이 (가) didMoveToSuperview
(으)로 호출되는 이유를 알지 못합니다.UIView removeFromSuperview가 didMoveToSuperview를 호출합니다.
didMoveToSuperview
은보기가보기에 추가 될 때만 호출됩니다. 누구든지 removeFromSuperview
이 didMoveToSuperview
으로 전화하는 이유를 설명 할 수 있습니까? 여기
removeFromSuperview
에서 무엇을하고 있는지 :
여기
public override func removeFromSuperview() {
clearDelegates()
chaosPad?.removeFromSuperview()
brushSliders?.removeFromSuperview()
moodSlider?.removeFromSuperview()
brushShapeMenu?.removeFromSuperview()
moodMenu?.removeFromSuperview()
gravityMenu?.removeFromSuperview()
rotationMenu?.removeFromSuperview()
menuGroups = []
centerButtons = []
scrollMenuItems = []
menu?.removeFromSuperview()
menu = nil
super.removeFromSuperview()
}
func clearDelegates() {
chaosPad?.delegate = nil
viewController = nil
}
는 didMoveToSuperview
가 호출 방법을 보여주는 호출 스택입니다 : 이것은 정상적인 동작입니다
#0 0x0000000110f39708 in specialized _fatalErrorMessage(StaticString, StaticString, StaticString, UInt) ->()()
#1 0x000000010b9cb960 in TDTOilistMenuPainting.configureFrames() ->() at /FastDev/TDTPhotoLib/Oilist/Classes/TDTOilistMenuPainting.swift:161
#2 0x000000010b9cb83e in TDTOilistMenuPainting.didMoveToSuperview() ->() at /FastDev/TDTPhotoLib/Oilist/Classes/TDTOilistMenuPainting.swift:146
#3 0x000000010b9cb872 in @objc TDTOilistMenuPainting.didMoveToSuperview() ->()()
#4 0x000000010f5d1db5 in __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke()
#5 0x000000010dc87c60 in -[NSISEngine withBehaviors:performModifications:]()
#6 0x000000010f5d19b1 in -[UIView(Hierarchy) _postMovedFromSuperview:]()
#7 0x000000010f5cf610 in __UIViewWasRemovedFromSuperview()
#8 0x000000010f5cf107 in -[UIView(Hierarchy) removeFromSuperview]()
#9 0x000000010b9c9aba in TDTOilistMenuPainting.removeFromSuperview() ->() at /FastDev/TDTPhotoLib/Oilist/Classes/TDTOilistMenuPainting.swift:73
#10 0x000000010ba6d269 in TDTPaintingViewController.(navigationController(UINavigationController, animationControllerForOperation : UINavigationControllerOperation, fromViewController : UIViewController, toViewController : UIViewController) -> UIViewControllerAnimatedTransitioning?).(closure #2) at /FastDev/TDTPhotoLib/Oilist/Classes/TDTPaintingViewController.swift:2706
당신이 내가 didMoveToSuperview'은'생각 것이다 "라고하셨습니까 보기가보기에 추가 될 때만 호출됩니까? " – TylerTheCompiler
예, 고맙습니다. 게시물을 편집했습니다. –