Cocoa NSTabView coding style question?

I think yours is a reasonable style. You create an NSViewController subclass for each tab, and assign it to the NSTabView using NSTabViewItem By the way, I think it's better to have NSViewController *tabAcontroller = TabAController alloc init with interface TabAController:NSViewController ... @end with init defined as init{ self=super initWithNibName:@"tabA" bundle:nil; if(self){ ... } return self; } Note that you don't need the extension nib when you call initWithNibName:bundle: And you should not specify the hard-coded path of the app. In iOS, the app's position is a given by the OS (with cryptic folder names,) but on OS X a user can freely move the app bundle to anywhere he wants.So, never refer to the main bundle as NSBundle bundleWithPath:@"hard coded path" Use just NSBundle mainBundle or just nil in most cases.

It's written in the documentation when you can just use nil.

I think yours is a reasonable style. You create an NSViewController subclass for each tab, and assign it to the NSTabView using NSTabViewItem. By the way, I think it's better to have NSViewController *tabAcontroller = TabAController alloc init; with @interface TabAController:NSViewController ... @end with init defined as -init{ self=super initWithNibName:@"tabA" bundle:nil; if(self){ ... } return self; } Note that you don't need the extension .

Nib when you call initWithNibName:bundle:. And you should not specify the hard-coded path of the app. In iOS, the app's position is a given by the OS (with cryptic folder names,) but on OS X a user can freely move the app bundle to anywhere he wants.So, never refer to the main bundle as NSBundle bundleWithPath:@"hard coded path".

Use just NSBundle mainBundle, or just nil in most cases. It's written in the documentation when you can just use nil.

GREAT. It's little things like suggesting subclassing (which helps encapsulation) that I'd never find anywhere. Thanks.

– Stephen Furlani Jul 28 '10 at 13:20 You're welcome. Each tab tends to be different, and it often needs specialized support codes, so I think it's better to put these codes in the specialized View Controllers. Then the controller of the tab view can just swap individual views.

– Yuji Jul 28 '10 at 15:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions