Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective C - how to get current screen resolution?

is there any way to get the users screen resolution with objective c?

Thanks.

Solution:

int width = [[NSScreen mainScreen] frame].size.width;
int height = [[NSScreen mainScreen] frame].size.height;
like image 846
dan Avatar asked Dec 08 '09 17:12

dan


2 Answers

Check out NSScreen.

like image 56
Nicholas Riley Avatar answered Oct 06 '22 11:10

Nicholas Riley


[UIScreen mainScreen].nativeBounds

like image 31
SingingDarren Avatar answered Oct 06 '22 11:10

SingingDarren