0 Replies Latest reply: Mar 15, 2012 9:34 AM by Tod Kuykendall
Tod Kuykendall Level 4 (2,270 points)

I'm interested in creating an interface that spontaneously creates tabs, which is simple, but I would also like for those tabs to contain more complex elements like an IKImageBrowserView. For consistency and ease of creation I would like to make these things once in IB and then reload the xibs as tabs are created, but I'm having trouble figuring out how to link the required code elements back to code for individual objects. I have created full-blown IKImageBrowser based applicatiosn and I thought this would be easy but I must be missing something conceptually because I've had little luck.


I created an NSViewController that contains an outlet declaration for the IKImageBrowserView, my imagearray and my routines to act as datasource and delegate etc and and the I created a xib that contains just my IKImageBrowserView. I set the File's Owner to the name of my NSViewController based class and made the connections for datasource and view. I intended to simply create a new one of these, add it to an NSMutableArray as long as the tab existed and add it to the new tab as they were created but so far it hasn't worked. I get visual feedback that the view is getting displayed but it doesn't display any images if you preload them.


Anyone have advice on the proper way to use a xib as a factory for spontaneously create views for things such as tabs? I thought I was on the right track but I've clearly missed something along the way.