Unlock second screen Objective c -


i have app lock screen , try multiple screens. don't know unlock second screen. here how unlock second screen :

if([[nsscreen screens] count] > 1){     // draw new window fill screen     nsscreen *screen;     nsrect screenrect = cgrectmake(0, 0, screen.frame.size.width , screen.frame.size.height);      nswindow *secondarymonitorwindow = [[nswindow alloc] initwithcontentrect:screenrect stylemask:nsborderlesswindowmask  backing:nsbackingstorebuffered  defer:no  screen:screen];       [secondarymonitorwindow.contentview exitfullscreenmodewithoptions:nil];   } 

i unlock first screen not second, if can me...

if needs fixed following code :

.m

[windowarray insertobject:self.window atindex:0];          //if have many screens         nsrect screenrect;         nsarray *screenarray = [nsscreen screens];         (nsinteger index = 1; index < [screenarray count]; index++)          {              nsscreen *screen = [screenarray objectatindex: index];              screenrect = cgrectmake(0, 0, screen.frame.size.width , screen.frame.size.height);             nswindow *window = [[nswindow alloc] initwithcontentrect:screenrect stylemask:nsborderlesswindowmask backing:nsbackingstorebuffered defer:no screen:screen];              [window.contentview setwantslayer:yes];             window.contentview.layer.backgroundcolor = [nscolor blackcolor].cgcolor;             [window.contentview enterfullscreenmode:[[nsscreen screens] objectatindex:index] withoptions:nil];               [windowarray addobject:window];          } 

don't forget add in .h

nsmutablearray *windowarray; 

and exitfullscreen :

for(nsinteger index = 1; index < [windowarray count]; index ++){              if([[windowarray objectatindex:index]contentview].infullscreenmode){                  [[[windowarray objectatindex:index]contentview] exitfullscreenmodewithoptions:nil];              }          } 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -