kyle k
kyle k

Reputation: 5512

Cocoa get number of open windows

I am making a simple app that will hide open windows, but I want to add a text box that will tell the number of open windows, what cocoa function do I need for this? is there a function in nswindow that I could use?

Upvotes: 1

Views: 1304

Answers (1)

Caleb
Caleb

Reputation: 124997

int windowCount = [[[NSApplication sharedApplication] windows] count];

That should do the trick.

Upvotes: 6

Related Questions