Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

abcdefg12345

macrumors 6502
Original poster
Jul 10, 2013
281
86
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
Code:
[COLOR="Red"]AppDelegate.h [/COLOR]

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>

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

[COLOR="Blue"]AppDelegate.m[/COLOR]

#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
 

Attachments

  • Simplest-NSTableView-Binding-master.zip
    59.1 KB · Views: 70
Last edited:
I'm lost... you mentioned a Table View but I don't see anything about a Table View in your code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.