Hi Quincey,
couple things: I don't think you CAN solve it. I think it is a systemmic issue with swift, or the way Swift works with Cocoa. As I said, this is not the first time I have experienced this. Now, as to the overall structure of the code, I am building a handful of frameworks, a mac document based app that loads a variety of plugins. So, there's a bunch of places where the system can just go sideways for me, and not others. But under no circumstances should any langugae that is objective in nature, ignore inheritence. I am alarmed by this behavior, and I am simply trying to sound the alram here.
ok, I think I can respond to your questions.
1. I have confirmed without any reservations that I have the class type that I am expecting. here are some of the ways that I know: My code does an "if let" where I test the type before making the calls that are being ignored. in the same sequence of method calls (in the same loop) the object that is communicating with my class, makes more than one method call, and I have stepped through watching that call succeed, and in addition I added a print command to that method, in my subclass that gets triggered without incident. and finally, I have checked the type at the breakpoint. It's my class, and it's overriden methods are being ignored.
2. very specifically, I have a framework that declares a base class. My class, the one I am dealing with at the moment (because as I mentioned... I've found others) is in the same framework. I import that framework into a Doc based Mac App, and subsequent plugins. Currently Instances that are misbehaving are children of the Document Class, and being managed by objects that are owned by the Document and the Application itself. Eventually, plugins will also interact with this class, but that is where we have the breakdown... the method that I have overridden is what starts communication with the plugin objects.
the base class's method is defined : @objc public func propertyUpdated()
the subclass's override looks like this: @objc public override func propertyUpdated()
my class is not directly derived from the base class. there is one intermediate class, and the intermediate class, does not override the method in question.
all classes are descendents of NSObject at some level or another.
there's no reference to a protocol defining this method. I'm not using _any_ protocols (of my own design, clearly there's no way to avoid using Apple protocols) in the project at all. I have found that Swift + Cocoa, doesn't like protocols or structures. I need frameworks and plugins, so I abandoned everything I did not specifically need.
this is the method in the base class:
@objc public func propertyUpdated(){
NotificationCenter.default.post(name: NSNotification.Name(rawValue: CNDagObjPropertiesUpdated) , object: self)
}
this is the method override in the subClass:
@objc public override func propertyUpdated(){
self.renderer?.nodeNeedsRender(self)
NotificationCenter.default.post(name: NSNotification.Name(rawValue: CNDagObjPropertiesUpdated) , object: self)
}
an objective language that breaks one of the fundamental tennets of objective langugaes, under any circumstances... bugs or not... has some serious low level problems. I 'get' that swift is trying to be Post-Objective... but it isn't when you have to use Cocoa, and that means Desktop Apps are all Objective. I am very concerned that the ground is not sound here.