25

I have an app which uses SlideMenuControllerSwift. I've modified some code to see how to present different panels, then rolled back my changes.

When running the project I get SIGABRT fatal error: call of deleted method in console when SlideMenuControllerSwift is initializing. No other error messages are given.

  • The project's source control appears to be in exactly the same state as before changes.
  • I did a "clean"
  • Reinstalled pods.
  • Deleted pods directory and made a clean install
  • Deleted app from device and ran again
  • Did a fresh checkout into a different folder
  • Updated cocoapods gem
  • Even modified the function to use self.addLeftGestures()

How do I debug an issue caused by cocoa pod throwing "fatal error: call of deleted method"?

enter image description here

UPDATE: seems like something is seriously broken with the functions inside that pod, calling another function within init causes bad access exception:

enter image description here

Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • Another developer working on the same branch has no issues. I've modified the cocoapod code to avoid calling that function, instead pasting the code right there – Alex Stone Jul 12 '17 at 09:41
  • Potential solution: https://stackoverflow.com/questions/38016143/how-to-delete-derived-data-in-xcode-8 – Alex Stone Jul 13 '17 at 03:02
  • I assume you were using pod and then decide to use it as a source but If you have a IBOutlet reference from Interface Builder. u should change its module target to your project target instead of removed pod target. – ugur Jun 18 '19 at 22:24
  • 1
    Just check Product -> Scheme -> Edit Scheme -> In Info section the scheme should be Debug not Release. – shubham mishra Jul 26 '19 at 09:17
  • My case was wrong class in IBOutlet – demensdeum Aug 05 '22 at 08:09

2 Answers2

38

In my case, I had created a project scheme that uses the release build configuration:

Edit Scheme

In this configuration, if your project build settings does not allow testability in this release mode then setting custom breakpoints or app crashes do not let you debug properly and you are served the fatal error: call of deleted method


Solution:

Check the project build settings for "testability".

Project Build Settings

Ensure it is "Yes" for the build configuration you are testing under.

In my case, I temporarily enabled testability for Release by making it Yes.

staticVoidMan
  • 19,275
  • 6
  • 69
  • 98
0

For anyone seeing this error using SwiftUI on XCode 11.4 and trying to access a property on an ObservableObject subclass eg.

class Model: ObservableObject {
    @Published var name = ""
}

class ModelSub: Model {}

let model = ModelSub()

// This line causes `fatal error: call of deleted method` on XCode 11.4
$model.name

// Instead do 
model._name.projectedValue

See more details here

chasew
  • 8,438
  • 7
  • 41
  • 48