Reputation: 1592
I'm looking for a way to get the current scene so that I'll be able to tell which scene is running at any time.
Thanks!
Upvotes: 12
Views: 10928
Reputation: 3051
Check out CCDirector
. You can get the running scene like this:
[[CCDirector sharedDirector] runningScene];
From the documentation of cocos2D:
-(CCScene*) runningScene [read, assign]
The current running Scene. Director can only run one Scene at the time
Sandro Meier
Upvotes: 29