Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我能够找到当前打开的窗口:
NSWindow *currentWindow = [NSApp keyWindow];
但是我怎么知道哪个类控制这个窗口,即上面窗口的窗口控制器?
试试这个:
NSLog(@"WindowController is : %@",[[currentWindow windowController] class]);