combs@sumex-aim.stanford.edu (Dave Combs) (09/07/89)
Gang, Is there some reason that the "owner" of an Interface Builder module file must be either Object or a direct subclass of Object? I'm interested in having an interface file read in where the "owner" would be a View subclass. I realize I can do this myself by specifying the View as the owner in loadNibSection:owner:, but I can't set the owner in IB itself to anything that isn't an Object or immediate subclass. This makes automatic initialization of instance variables in the owner impossible. Thanks, Dave (combs@sumex-aim.stanford.edu)
jpd00964@uxa.cso.uiuc.edu (09/08/89)
/* Written 5:23 pm Sep 6, 1989 by combs@sumex-aim.stanford.edu in uxa.cso.uiuc.edu:comp.sys.next */ /* ---------- ""owner" of IB Module files" ---------- */ >Is there some reason that the "owner" of an Interface Builder module file >must be either Object or a direct subclass of Object? I'm interested in >having an interface file read in where the "owner" would be a View subclass. >I realize I can do this myself by specifying the View as the owner in >loadNibSection:owner:, but I can't set the owner in IB itself to anything >that isn't an Object or immediate subclass. This makes automatic >initialization of instance variables in the owner impossible. Well, I can give you a simple work around. Call your view object that you want to make the owner <<object>>View. Create a subclass of Object called <<object>>. Have <<object>> be the owner, with a customview in it set to <<object>>View. <<object>> has one instance varaible, myView, which goes to your <<object>>View. It also repeats all of <<object>>View's methods and sends them to <<object>>View. Real simple, and it will work. Most likely, as you start to do this, you will realize that there are more efficeint ways. Namely, let <<object>> handle everything but the actual image, and have it send <<object>>View all the information it needs. Michael Rutman Softmed