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

kikko088

macrumors member
Original poster
Oct 13, 2010
77
0
Italy
I have a little problem, I want to change the view of my NSTabView from a Tab View...If I create an action with

Code:
selectNextTabViewItem

on the window controller (where I define the nstabview outlet) all work perfectly...if I do something like this

Code:
AppController *controller = [[AppController alloc] init];
[controller.tabView selectNextTabViewItem:nil];

also if I do

Code:
- (void) next
{
    [self.tabView selectNextTabViewItem:nil]; 
}
    AppController *controller = [[AppController alloc] init];
    [controller next];

where is the error?
 
Are you sure you want to be creating a new AppController object? I would think you'd be wanting to access an exiting AppController object.
 
In theory yes (I'm a beginner :( ), I have my AppController where I define a TabView Outlet, inside this TabView I have an NSView, If I want to change the tab from the NSView I have to create a new Object of AppController use a method of AppController for change the tab.
Is wrong?


kikko088
 
If you create a new AppController, its TabView outlet won't be set. What is AppController and how it is rigged up? For example, is it your app delegate or is it an object you've added to a .xib file?
 
I create a new project from a clean app, so you can see where is the error :)
 

Attachments

  • Test.zip
    96.9 KB · Views: 62
Don't create a new MyDocument in PrimaVista's change: method. Instead add an outlet to MyDocument in PrimaVista. Connect the outlet to the File's Owner in MyDocument.xib.
 
mmm I understand but isn't the good way for what I have to do (I think :D)...I want to do a route, in the first tab I set a variable, in the second tab I set anorther var, in the third tab I summarize all varibale.
Then I need that the action of nextTab is on class controller (PrimaVista).


thank you for your help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.