I’m having some issues with understanding how to work with NSViewControllers on Mac. I’m trying to create custom table cells for NSTableView. In one of the delegates of the NSTableView, it can return a view, instead of a cell.
I have a subclass of NSViewController, and in the .xib everything is linked up correctly, but when I initialize the NSViewController, its UI components is not initialized… not even the default view that comes with it. I have tried it with a clean, stock, untouched implementation of NSViewController, just to make sure that the issue is not with something I’m doing. It is probably. I am initializing the NSViewController as follows:
testview *tmpChannel = [[testview alloc] initWithNibName:@"testview" bundle:nil];
The .xib does exist, and all the outlets are linked up correctly. Could anyone explain what is happening here? I’m using xCode 4.1 with Lion OS
Thanks.
Check your initialization with
From your code I would assume, that you do get an object address here. That means the error is probably in the code that is supposed to display it.
BTW, I recommend using capitalized class names, such as
TestView.EDIT:
Additional Information for loading xibs: The name of the xib file has to be the exact same as the class name. In this case you can actually completely omit the
initWithNibName:bundle:part: