PDA

View Full Version : Open Mac Tabs With Table View Xcode




abcdefg12345
Jul 11, 2013, 01:28 AM
Im Trying to make an app with Xcode and I want to add tabs that can be opened with Table View The problem I cant link the codes with the table is there a way to programatically make a tab change when a different button is pressed on a table

thats what I'm unto

AppDelegate.h

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>

@property (assign) IBOutlet NSWindow *Window;
@property (weak) IBOutlet NSArrayController *arrayController;

AppDelegate.m

#import "AppDelegate.h"

@implementation AppDelegate

@synthesize Window = _window;
@synthesize arrayController = _arrayController;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[_arrayController addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Tab1", @"name",
nil
]
];

[_arrayController addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Tab2", @"name",
nil
]
];

[_arrayController addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Tab3", @"name",
nil
]
];
}

is there a way i can add something to the codes to open tabs when buttons are pressed.

i attached an example code is there a way to edit it to change tabs with the table view



ArtOfWarfare
Jul 11, 2013, 10:37 AM
I'm lost... you mentioned a Table View but I don't see anything about a Table View in your code.