1. 再次打开窗口时,位置与上次最终位置相同 [window orderFront:self];//该代码可以记录位置 [[NSApplication sharedApplication] runModalForWindow:window];