I could not find a more suitable name for this. This is the scenario:
final class Something : UIViewController { fileprivate var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.tableView = UITableView(frame: CGRect.zero, style: .plain) self.tableView.translatesAutoresizingMaskIntoConstraints = false
EDIT . If you do not specify an explicit type annotation, the compiler will select [String: UITableView?] In this particular case.
Now, if I cannot explicitly tell the compiler that the views are of type [String: Any] (for example, a commented thing), this code crashes and I get a neat little crash giving me the middle finger with this message
-[_SwiftValue nsli_superitem]: unrecognized selector sent to instance 0x60000044a560
Things like this happen everywhere after migrating from Swift 2.x. Can someone shed light on this topic? Why is this happening? How to avoid such things? How to detect the origin of such failures (some of them are very difficult to track)?
ios swift swift3
Majster
source share