Communicating between classes set up in nib, in code?
        Posted  
        
            by cannyboy
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by cannyboy
        
        
        
        Published on 2010-06-12T09:54:13Z
        Indexed on 
            2010/06/12
            10:22 UTC
        
        
        Read the original article
        Hit count: 288
        
A beginner's question:
If, in your nib, you have the File's Owner linked to the ViewController class, and you also have a NSObject-derived class, how do you communicate between the ViewController class and the NSObject class within code?
For instance, suppose ScientificCalculatorView.xib looks like this
File's Owner  (class: ScientificCalculatorViewController)
FirstResponder
View
Calculator  (an object that has been linked to the Calculator class)
Obviously, I'd want Calculator to be reusable, so it could be used with a NormalCalculatorViewController or something like that. So that UI and the calculator code are separate. Does Calculator even need to be in the nib?
It's a beginners question, but I'm just trying to get my head around it.
© Stack Overflow or respective owner