I am making my first OSX app. My appDelegate has a window which has a contentView of NSViewController. This NSViewController has a custom view which displays on startup. I added an NSScrollView as a property of my NSViewController, and in the xib I put it in the correct position and referenced it to the files owner (the NSViewController). The scrollView never displays when the view is displayed. The code that includes the scrollView is as follows:
in the .h for the viewController:
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import "StockData.h"
@interface MasterViewController : NSViewController {
IBOutlet NSScrollView * scrollView1;
}
@property (retain) IBOutlet NSScrollView * scrollView1;
@property (retain) NSView * contents;
@end
in the .m for the viewController:
#import "MasterViewController.h"
#import <math.h>
#import <Foundation/Foundation.h>
@implementation MasterViewController
@synthesize scrollView1, contents;
- (void) awakeFromNib
{
self.scrollView1 = [[NSScrollView alloc] init];
self.contents = [[NSView alloc] initWithFrame:NSMakeRect(0,0,430,1000)];
[self.view addSubview:scrollView1];
[self.scrollView1 setDocumentView:self.contents];
}
@end
If anyone could help that would be awesome! Thanks!