0

i am trying to archiv something really simple.

I add a property for a NSScrollView in my ViewController header file called PanelController:

@property (strong) IBOutlet NSScrollView *listurls_fld;

I add the ViewController.h file to my NSObject Interface called "qhandler.h"

#import "handler.h"
#import "PanelController.h"

i have a +(void) function inside the qhandler.m ->

+ (void)do_handle:(NSDictionary *)response
{
    PanelController *MyView=[[PanelController alloc] init];
    NSLog(@"add moo");
    [MyView.listurls_fld setStringValue:@"moo"];
}

which doesn't work...

It does neither work with setAlphaValue or whatever, i guess it's because i am allocating a new instance of PanelController, but as a matter of fact, I tried to change the main instance.

I know it's basic but i have enormous problems using IBOutlets from a viewcontroller, inside an external obj-c file.

Thanks, john

gaige
  • 17,263
  • 6
  • 57
  • 68
  • Does the NSLog get called? You definitely don't want to create a new `PanelController` and operate on that, since it won't do what you need. How do you put your PanelController into a window? – gaige Apr 23 '13 at 22:20

1 Answers1

0

ViewController.h

id mainDelegate;

ViewController.m in viewDidLoad oder what function ever triggers after load:

mainDelegate=self;

so i can use [mainDelegate ...:..]; in every file..