'soundID' undeclared

Discussion in 'iOS Programming' started by codenamecueball, Jun 26, 2010.

  1. codenamecueball macrumors regular

    Jul 28, 2009
    Hi there programming forum.

    I am currently writing an app which plays a sound when a picture is tapped or hit or whatever. The code I am using is here
    - (IBAction)HighFive{
    	//Get the filename of the sound file:
    	NSString *path = [NSString stringWithFormat:@"%@%@",
    					  [[NSBundle mainBundle] resourcePath],
    	//declare a system sound id
    	SystemSoundID ;soundID;      < 'soundID' undeclared
    	//Get a URL for the sound file
    	NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
    	//Use audio sevices to create the sound
    	AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
    	//Use audio services to play the sound
    What am I doing wrong and how do I get this to work :(
  2. codenamecueball thread starter macrumors regular

    Jul 28, 2009
    Ok, never mind, misplaced colon. Now I need to make it so when the image is tapped the sound plays. Would a button with the alpha set to 0 work? :apple:

Share This Page