playing Random sounds on a soundboard app

前端 未结 1 429
闹比i
闹比i 2021-01-27 17:10

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

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 17:18

    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 
    
    @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.

    0 讨论(0)
提交回复
热议问题