I have doubt and need some suggestion on following code,
NSArray* onscreenwindows = (NSArray*)CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly, kCGNullWindowID);
Which one of the following release is right?
if(onscreenwindows)
{
...
[onscreenwindows release];
}
OR
if(onscreenwindows)
{
...
CFArrayRef cfonscreenwindow = (CFArrayRef)onscreenwindows
CFRelease(cfonscreenwindow);
}
Since they are toll-free bridged you can use both, as you like.