so I have this variable in my delegate named AppDelegate.h:
AVAudioPlayer *introSound;
It plays continuously during first load.
[introSound stop];
What I want to do is stop it from a separate controller, firstController.m.
I tried
[AppDelegate.introSound stop];
but it threw an error saying:
error: expected ‘:’ before ‘.’ token
What is causing this?
I assume you mean a compiler error? AppDelegate refers to the class, not to the instance of the class that is your application delegate. To get that from anywhere, do this:
You also need to make sure that introSound is a property, not just an instance variable of AppDelegate.