Adding multiple Cib / Xib files in Cappuccino - interface-builder

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!

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.

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.

Related

IBOutlet connect fails to connect to renamed target

So, I was following along a core-data tutorial RayWenderlich.com part 1/3 circa 2012 using Xcode 8. Naturally some things are different now, like the default view controller and storyboards vs xib being used.
So rather than explicitly creating a xib for the MasterViewController, etc. (I instead did things the Xcode 8 way), I just renamed the supplied ViewController, and the associated .h and .m contents to MasterViewController. All was fine until I got to the step to add its outlet in the app delegate.
No joy.
Snippet shows the outlet is there but I cannot link to it.
I uploaded the project to ScaryBugsMac on github as I'm stuck what's wrong. Tried suggestions on similar question to remove/add, import vs include for the header, and to publish the outlet by putting it in the app delegate header.
I'm thinking the rename isn't being handled but I want to know how it's broken and how to fix it.
Well I punted and restarted, this time without renaming the controller. Find "part 1" of the tutorial in ScaryBug on github.

Accessing image from PaintCode in Swift

I'm thinking about buying PaintCode, because I wanna use it in my Swift projects. I downloaded the Trial version. The tutorials at the homepage are only for Objective C, but the explained way (http://www.paintcodeapp.com/documentation/stylekits) doesn't work with Swift.
Any ideas, how I can add the images from PaintCode to my xib file (for example to a toolbar item)? (I have a Cocoa project without Storyboard)
Paintcode works with Swift you just have to change the output.
You can choose iOS/Obj-c , OSX/iOS.
PaintCode works well with Swift. You only have to select the output as pointed by a comment before and export StyleKit to your project.

Internationalizing .xib files in Xcode

I have a simple Mac app that I want to internationalize. I know how to use NSLocalizedString etc., and this seems very convenient and well thought out.
However, I also need to internationalize a .xib file in my project. I found this post about the process.
I tried it out, and it works, but strikes me as an extremely bad idea. Is there really no better way? What following the post produces is a bunch of copies of the .xib file, one for each language:
This works fine, until you decide to change an element in the interface, because then you have to go to each language, and change the element in every single one.
Is there a better way to internationalize the xib files?
You might want to use "base internationalization". It allows you to internationalize the strings without messing with the nib files.
However, it requires iOS 6, and it works best when used with Autolayout.
There is a section about base internationalizationin the handy Internationalize Your App Guide.
If you need to support iOS 5 you have to use your way. Or, as I prefer it, connect all UIViews to a IBOutlet and replace all texts in viewDidLoad.

Creating MonoTouch Custom Cells using XCode 4 does not work

I was used to creating Custom Cells in MonoTouch using Interface Builder but ever since XCode 4 has this integrated I can't seem to get it to work.
Is this a know issue?
Does anyone know of an article that describes how to go about this? I have plenty of books and found articles about how this works in XCode 3 (Interface Builder) but I am looking at how this works in XCode 4 !!
Also, when creating iPad View Controllers in MonoTouch the files seem to be separated (I get an fHeader.cs and a fHeader.xib file) whereas before the fHeader.cs file was 'part of' the xib file (hierarchically below it). Why is this?
I am using Mono 2.10.9 - XCode 4.2 and Monotouch 5.2.11
Thanks
This has a nice tutorial:
http://blog.arcticmill.com/2012/05/uitableview-with-custom-uitableviewcell.html
Check this tutorial:
http://sabonrai.wordpress.com/2009/08/28/monotouch-sample-code-uitableview/
Normally you create a DataSource Delegate and there you override the GetCell function.
In this function you can create your custom cell.

How to create an iPhone application starting from an empty project and then adding one resource at a time?

Instead of using the standard Xcode provided templates (view based, window based etc), is it possible to create a full fledged iPhone application by starting with an empty project ?
I mean can one first create an empty project first, and then one at a time, add the main.m file, then import the Frameworks, then add an xib, add UIApplication delegate class, make necessary connections etc...
Has anyone tried this? It would certainly help one understand the basic anatomy of an iPhone application.
Yes. At least in Xcode 4.2, there is the "Empty" project template with no files, targets or build configurations.

Resources