I have been trying to create a app that when I press a button it plays a sound but then when I press the same button again it plays a different sound I don\'t mind if it plays i
You have many problems with this. It's hard to answer your actual question because you have lots of little problems that are getting in the way.
To give you some help:
this is incorrect:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@class AVAudioPlayer;
@interface ViewController : UIViewController
As the image you have posted, even Xcode is trying to help you. The @class
forward declaration is in the wrong place. Try putting it just after the #import
statements. Because of this your soundplayer isn't being created properly and you are getting other warnings.
You need to fix all the errors and then all the warnings and keep doing this until it builds cleanly.