I am trying to create a protocol for JSON loading delegation, JSONLoaderDelegate
. My other class, called JSONLoader
, is supposed to dispatch events
I faced this problem as I had a class MyConnection
that had no parent class.
Like this.
public class MyConnection {
}
I can't put @objc
before this, as I get a warning
Only classes that inherit from NSObject can be declared @objc
So I changed the class to be inherited from NSObject
.
Like this
public class MyConnection: NSObject {
}