4 Replies
      Latest reply on Jul 12, 2018 6:11 PM by Jack Ni
      Jack Ni Level 1 Level 1 (0 points)

        mac version:10.13

        i just write the below code, then i found the memory rise when execute the for {} statement,1426 is other window's id:

        NSWindow* mainWindow = [[NSApplication sharedApplication] mainWindow];
        for(int i = 0; i < 60*60*100;++i)
        //[mainWindow orderWindow:NSWindowBelow relativeTo:1426];
        [mainWindow orderFrontRegardless];

        i doubt the  orderWindow api may have memory leaks, can anyone give me some suggest how to explain the situation or  give me a alternative api to let my own window always follow a special other application's window.