osx - Cocoa NSTabView coding style question -
I have a coding style question that should be asked about a senior Mac programmer at work - but since I am alone Well, I have a pop-up GUI for my software (3D model, data visualization) and pop-up, mainly with a tabbed control, each tab (slider, radio button, checkbox, etc.) There is a ton of stuff with stuff like some 20 Rati Controls tab, and perhaps half a dozen tabs ... using a controller for all the scenes is to raise much faster load.
Is there a main visual controller that loads a nice style of tabs?
NSView * tabA = [[NSView alloc] initWithNibName: @ "tabA.nib" bundle: [NSBundle bundleWithPath: @ "/ application / BOB.app"]] ;; NSView * tabB = [[NSView alloc] initWithNibName: @ "tabB.nib" bundle: [NSBundle bundleWithPath: @ "/ Application / BOB.app"]] ;;
How does this do it on iOS, but I'm not sure for Mac OS X. I like a style that provides maintenance and flexibility, because the code is going through the prototype and I
thanks!
I think your style is the proper one for each NSViewController
Create subclasses, and assign it to NSTabViewItem
by using NSTabView
.
By the way, I think it is better to have it
NSViewController * tabAcontroller = [[TabAController alloc] init]; with @interface TabAController: NSViewController ... @end
with as defined in -inet {self = [super intite wide NIBN: @ "tabe" bundle: nil]; If (self) {...} return itself; }
Note that you do not need the extension .nib
when you call initWithNibName: bundle:
. And you should not not specify the hard-coded path of the app In iOS, the position of the app is given by the OS (with the name of the secret folder), but a user app bundle on OS X Can take anywhere he wants. Therefore, never see the main bundle as [NSBindal bundlewith path: @ "hard coded path"]
. In most cases simply use [NSBundle mainBundle]
, or simply Zero
when you can only use Zero
, in this documentation Has been written.
Comments
Post a Comment