I created a custom NSTextView
subclass called JWTextView
. It's part of a separate Xcode project. That project has a target that creates a static library containing this class. I now added this subproject to my main project under MainProject/Libraries/JWKit
(in Finder) and added it in Xcode as well. I made my main project's target depend on the subproject's library target and I'm linking the library in my main target. I also added MainProject/Libraries/**
to the Library and Header search paths.
Now I'm trying to use this view in my main project. I added an NSTextView
to one of my xib's and changed its class to JWTextView
. I also have an IBOutlet JWTextView
in my code and call some methods on it upon user interaction. JWTextView.h
is imported. Everything compiles file.
But once I call a method on this text view that I implemented in my JWTextView
subclass, the app crashes with an unrecognized selector error:
-[NSTextView myCustomMetod:]: unrecognized selector sent to instance 0x101901a80
I checked, and it's actually an NSTextView
instance, even tough the ivar is a JWTextView
and I set the class in IB.
If I just add the classes to my main project it works fine, but not as a subproject and a static library.