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.
Mac OS のモニター数を Cocoa で調べたい。カーボンが使えない。このコードはカーボンで書かれているが、Cocoa フレームワークでやりたい。
CGDisplayCount dspCount; CGError err ; err = CGGetActiveDisplayList(0, NULL, &dspCount); return (int)dspCount;
NSScreenクラスを使用します。
NSScreen
return [[NSScreen screens] count];
リファレンスを参照してください。