2

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

this Library

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)

}

Community
  • 1
  • 1
remy boys
  • 2,928
  • 5
  • 36
  • 65
  • 1
    Me! My experience is that that may not be the line which is causing the problem. Try commenting out sections of the method and compiling. Maybe the constants have lowercase forms – Hong Wei Sep 16 '16 at 14:06
  • @HongWei please check the updated question i mentioned wrong lines sorry my bad – remy boys Sep 16 '16 at 14:42

3 Answers3

2

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)

Hong Wei
  • 1,397
  • 1
  • 11
  • 16
0

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.

Abhishek Mishra
  • 1,625
  • 16
  • 32
0

I have faced the same issue now. You should use NotificationCenter.default.removeObserver(self) in your deinit or viewDidDisappear methods.

Slavcho
  • 2,792
  • 3
  • 30
  • 48