1

Currently I'm working on a product that uses the Cappuccino Framework and the Objective-J language.

I created my project using this command after installing Cappuccino: capp gen -t NibApplication Myapp

The Problem I'm facing is that I want to keep my code and GUI clean. By doing so I wanted to split the GUI up in separate Xib / Cib (compiled version Cappuccino can read) and separate controllers, like I do with iOS and Mac apps.

I couldn't find on the internet or on the docs how to do so.

Also, all the examples (including the NibApplication template) contains only 1 xib file.

In short what I'm after is to load a controller, based on a XIB file which holds the window. All the outlets are connected to the controller I loaded.

Is there anyone who knows how to do it?

Thanks in advance and have a nice day!

Peter Willemsen
  • 735
  • 1
  • 7
  • 13

2 Answers2

1

The typical way to do this is to use a CPWindowController or a CPViewController for each xib you want to load. Here's what it might look like:

var myViewController = [[CPViewController alloc] initWithCibName:"mynib" bundle:[CPBundle mainBundle]];

This would load Resources/mynib.cib from your main bundle. Normally you'd also subclass CPViewController so as to give yourself a convenient spot for your control code.

Alexander Ljungberg
  • 6,302
  • 4
  • 31
  • 37
0

Fixed it myself! I used this tutorial: http://vimeo.com/8948460 But instead of using atlas I used XCode. Just follow the steps but with XCode and you'll be fine if you want the above to happen.

Peter Willemsen
  • 735
  • 1
  • 7
  • 13