This is a silly beginner question but… If I have a custom subclass of NSTextView “SSTextView” that spawns from Interface Builder, how do I access the instance of my custom class that is actually in the interface from inside SSTextView.m? The overall goal, I guess, is to be able to call an instance method in SSTextView.m from another method in the file. I know that [self aMethod] only works for class methods.
Now, I know I can do this from another class’s implementation by using IBOutlet SSTextView *myTextView; and making the connections in Interface Builder, but it seems like an odd organizational paradigm that I wouldn’t be able to put the methods that deal with my user interface text view in its own implementation.
Thanks in advance.
You’ve got this part backwards:
[self aMethod]is how you invoke an instance method on the current object.[MyClass aMethod]is how you invoke a class method.