Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sergio10

macrumors regular
Original poster
Oct 3, 2007
137
0
Hi,

What is the difference between NSObject and NSObjectController?

MMWku84Rvd.png


Thanks,
Sergio
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.