NSObject and NSObjectController

Discussion in 'Mac Programming' started by Sergio10, Mar 29, 2009.

  1. macrumors regular


    What is the difference between NSObject and NSObjectController?


  2. macrumors 6502a

    In InterfaceBuilder a NSObject item is tied to a single instance of an object and will instantiate that object when the nib is being awoken, whereas a NSObjectController is more of a generic pointer at an object of a certain type. NSObjectControllers do not cause anything to be instantiated just by being in a nib, but point at nil unless tied to something.

    A way of illustrating this is when you have a an NSObjectController pointing at a NSArrayController pointing at "selectedObject". When the selected object changes that NSObjectController now points at a different object, but the objects themselves have not changed.

Share This Page