This code makes my app to crash because awakeFromNib is invoked recursively:
- (void)awakeFromNib
{
[super awakeFromNib];
...
[[self window] setFrameTopLeftPoint:NSMakePoint(frame.origin.x, frame.origin.y)];
}
Is setFrameTopLeftPoint invoking awakeFromNib again ? I thought awakeFromNib is invoked only once, when the NSWindow is loaded by the XIB file.
How can I update a window position and size from awakeFromNib ?
thanks
I don’t know why you’re getting infinite recursion in awakeFromNib. I created a test project mimicking your code and -awakeFromNib was only called once. I suspect it has something to do with the way you’re initializing your window controller.
That said, updating the window position would probably be better done in -windowDidLoad. From the “Subclassing NSWindowController” section of the docs, it says: