Search code examples
macoscocoanswindowappkitcocoa-sheet

Check if a sheet is open


I'm writing a Cocoa app and basically I have a window and I need to check if a sheet is open before I open another window. Google doesn't seem to know that one. How may I check if the sheet is open or not?


Solution

  • -[NSWindow attachedSheet]

    BOOL hasSheet = ([window attachedSheet] != nil);