Search code examples
iosobjective-cswiftautolayoutunrecognized-selector

app crashes on isHidden property


I just converted the code from objective-c to swift and now there are some unknown crashes occurring in my app.

  1. The app crashes on every outlet property whose visibility I change using selectedView.isHidden = false. The error is [Controller _mutableLayoutArrangements]: unrecognized selector sent to instance

  2. When I commented out isHidden then viewDidLoad method a crash occur by saying [Controller _hostsLayoutEngine]: unrecognized selector sent to instance

I did some research but didn't find an exact reason for this behaviour. But I have some idea that these crashes are due to autolayout constraint crashes. But I'm not sure of this.

I found a line related to crash but I'm not able to solve the issue layoutSublayersOfLayer:


Solution

  • The solution to this problem i find is not usual, I checked that these issues I was facing "mutableLayoutArrangements and hostsLayoutEngine" are part of AGSLayer.

    Then i checked and found i was importing the AGSLayer delegate. Removing the delegate solved my issue. Actually previously I was using this for arcGis library.