Hi there,
i have been trying for a while now to do either of two things wtih no luck.
1- create an nsview programmatically and add it as a subview to a current content view like this
i recieve this error, [NSView addSubview:] unrecognised selector sent to object 0x109x04 (whatever)
2-
add a subview to a current view using a CustomNSWindowController and a sepparate xib (nib) file. The nib file has a an additional (other than the one in the window item) custom view that has a connected outlet in the CustomNSWindowController interface and impelentation.
the custom NSWindowController works very well when i want a separate window out of it by calling the window method like this
however, if i try to add the customView as a subview of the current content view it does not work (basically i have the customView as nil
customView is always nil.
i would appreciate any help in anyone of these two methods.
i have been trying for a while now to do either of two things wtih no luck.
1- create an nsview programmatically and add it as a subview to a current content view like this
Code:
NSView *view = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)];
[[window contentView] addSubview: view];
i recieve this error, [NSView addSubview:] unrecognised selector sent to object 0x109x04 (whatever)
2-
add a subview to a current view using a CustomNSWindowController and a sepparate xib (nib) file. The nib file has a an additional (other than the one in the window item) custom view that has a connected outlet in the CustomNSWindowController interface and impelentation.
Code:
@interface CustomNSWindowController: NSWindowController
{
IBOutlet NSView *customView;
}
@end
the custom NSWindowController works very well when i want a separate window out of it by calling the window method like this
Code:
CustomNSWindowController *controller = [[CustomNSWindowController alloc] initWithNibName: @"myNib"];
[controller window] pops up that window beautifully
however, if i try to add the customView as a subview of the current content view it does not work (basically i have the customView as nil
Code:
[[window contentview] addSubview: [controller customView]];
customView is always nil.
i would appreciate any help in anyone of these two methods.