Reputation: 2958
just updated my Xcode and got this error in one of my previous project i searched around a bit and found this question according to that question this is Xcode bug. i dont have any idea how to fix it cause the error message is not giving me any clue about the error and why its occurring. so far what i have is this :
Command failed due to signal: Segmentation fault: 11
and error's logs contains this class's name and this class is the part of
anyone have faced any similar problem ??
i got some lead . my error is pointing to a line :
While emitting IR SIL function @_TFC12SCLAlertView12SCLAlertView16viewDidDisappearfSbT_ for 'viewDidDisappear' at mydirectorytoproject/mProject/Pods/SCLAlertView/SCLAlertView/SCLAlertView.swift:379:19
here's the line 379 on my class:
override open func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
NotificationCenter.default.removeObserver(NSNotification.Name.UIKeyboardWillShow)
NotificationCenter.default.removeObserver(NSNotification.Name.UIKeyboardWillHide)
}
Upvotes: 2
Views: 3529
Reputation: 2812
I have faced the same issue now.
You should use NotificationCenter.default.removeObserver(self)
in your deinit
or viewDidDisappear
methods.
Upvotes: 0
Reputation: 1655
I think , You are added same file two times in your Project.
Check all the files and remove.
i think it will help you because it is working for me.
Upvotes: 0
Reputation: 1407
I think your observer is wrong. You are putting the notification name instead of the observer:
NotificationCenter.default.removeObserver(NSNotification.Name.UIKeyboardWillShow)
NotificationCenter.default.removeObserver(NSNotification.Name.UIKeyboardWillHide)
Try something like if your observer is the current class:
NotificationCenter.default.removeObserver(self)
Also, I think you do not need open
in override open func viewDidDisappear(_ animated: Bool)
Upvotes: 2