Search code examples
iphoneobjective-cxcodeframeworksnssound

NSSound undeclared on iPhone?


sound = [[NSSound alloc] initWithContentsOfFile:@"staticbeam09.wav" byReference:YES];

Code referenced from Apple docs. Getting an error when I put this in viewDidLoad. If I put

NSSound *sound;

in the header file, I get the specifier-qualifier error at the top of my implementation file. What do I have to do to make this work? I was just pasting the code from Apple's documentation - has this been deprecated? Thanks for your help!


Solution

  • http://icodeblog.com/2009/05/04/iphone-game-programming-tutorial-part-4-basic-game-audio/

    that is how i did the audio bg music and sound effects at the end for iconquer