Open Mac Tabs With Table View Xcode

Discussion in 'Mac Programming' started by abcdefg12345, Jul 10, 2013.

  1. abcdefg12345, Jul 10, 2013
    Last edited: Jul 12, 2013

    macrumors regular

    abcdefg12345

    Joined:
    Jul 10, 2013
    #1
    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
     

    Attached Files:

  2. macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    I'm lost... you mentioned a Table View but I don't see anything about a Table View in your code.
     

Share This Page