I am writing an OS X application. I would like to find a NSView position on the whole screen. How can I find that position. I don't want this position related to the NSWindow, but the position on the whole screen. Is this possible to do so? Or I need to use NSWindow's location information to find that? Thanks.
You can use NSWindow
’s method -convertRectToScreen:
to convert the rectangle to the screen coordinate system from the window’s coordinate system.
NSRect rectInScreen = [self.view.window convertRectToScreen:self.view.frame];
Documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With