I am new to Obj-c/Cocoa and want to know how to get one NSWindow's ID/number?
The following member variable of NSWindow is found on Apple's website.
var windowNumber: Int
The window number of the window’s window device.
However how to get it? Shall I just use
NSWindow aWindow;
[aWindow getWindowNumber];
Thanks a lot!
In Objective-C:
NSWindow* myWindow = ...;
NSInteger windowNumber = myWindow.windowNumber;
In Swift:
let myWindow = ...
let windowNumber = myWindow.windowNumber
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.