简体   繁体   中英

How can one NSWindow's ID be got

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM