objective c - How to find monitor count in mac os by Cocoa? -


i want find count of monitor in mac os cocoa.i can not use carbon.this code written in carbon want in cocoa framework.

cgdisplaycount dspcount; cgerror err ; err = cggetactivedisplaylist(0, null, &dspcount); return (int)dspcount; 

use nsscreen class:

return [[nsscreen screens] count]; 

see reference.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -