Reading NSWindow resize event
in the awake from nib of your .m file write
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenResize) name:NSWindowDidResizeNotification object:nil];
and create a method now
(void)screenResize
{
NSRect rect = Preloader.frame;
rect = NSMakeRect(self.view.frame.origin.x+self.view.frame.size.width/2, self.view.frame.origin.y+self.view.frame.size.height/2, Preloader.frame.size.width, Preloader.frame.size.height);
Preloader.frame = rect;
NSLog(@"X = %f, Y = %f, W = %f, H= %f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
}
and when you get out of that class write
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:nil];
Can you use the ‑windowDidResize:
delegate method?