This is what i am doing
- Create a new 10.9 cocoa application
- Drag a drop a custom view to the top right corner - by leaving the default size of the custom view
- In Appdelegate.h i create this line by cmd+drag -> @property (weak) IBOutlet NSView *myView;
- In Appdelegate.m i synthesize like -> @synthesize myView;
Then i add this code
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
[myView setWantsLayer:YES];
myView.layer.backgroundColor = CGColorCreateGenericRGB(0,0,0,0.5);
NSRect vFrame = myView.frame;
vFrame.origin.x = 0;
vFrame.origin.y = 0;
vFrame.size.width = 100;
vFrame.size.height = 100;
[myView setFrame:vFrame];
}
The question i have is - whenever i resize my window the myView (my NSView) switches to to it original position and size. All i want it it should not change it's origin or size even if i resize