Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / June 2007



Tip: Looking for answers? Try searching our database.

Loading a nib view into another nib.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wanted.creative@gmail.com - 22 Jun 2007 04:24 GMT
I am learning cocoa slowly and right now I am trying to learn about
building custom interfaces. One thing I cannot seem to find any
information about is if its possible to lead a part of one nib into a
seperate nib.

What I mean is if I have a CustomView in one nib file would it be
possible to load a view from another nib file into it? I started
thinking about this kind of idea when I was taking a look at the nib
files in Disco.app. Can anyone point me in the right direction to
look? Thank you very much.
Michael Ash - 22 Jun 2007 05:03 GMT
> I am learning cocoa slowly and right now I am trying to learn about
> building custom interfaces. One thing I cannot seem to find any
[quoted text clipped - 6 lines]
> files in Disco.app. Can anyone point me in the right direction to
> look? Thank you very much.

Certainly, but you're thinking about the problem in kind of the wrong way.

Nibs just give you objects. You can't load one nib "into" another one,
because the nib doesn't exist once it's loaded. A nib is just a file on
disk. After you load it, you no longer have a nib. Instead, you have a
window, some views, etc.

So you have one nib with a CustomView and another nib with another views.
After you've loaded them both, you have an NSView and then a bunch of
other NSViews. Can you add these other NSViews to your first NSView?
Absolutely. A perusal of the NSView documentation would be in order, but
you'll find methods like -addSubview: will get you where you want to go.

Signature

Michael Ash
Rogue Amoeba Software

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.