expected ';' before '{' token please help ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Sveide
    New Member
    • Nov 2011
    • 6

    expected ';' before '{' token please help ?

    hi

    im trying to make an simple app and i where almost done

    but then this error apear and i just cant figure out how to fix it !

    Please help me im desperate?



    the error says: expected ';' before '{' token

    Code:
    -(IBAction)playsound {
    
    	
    	NSString *path = [[NSBundle mainBundle] pathForResource:@"ljudeffectha" ofType:@"wav"];
    	
    	AVAudioPlayer* myAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
    	
    	myAudio.delegate = self;
    	
    	myAudio.volume = 2.0;
    	
    	myAudio.numberOfLoops = 1;
    	
    	[myAudio play]; 
    
    
    
    
    @end
    Attached Files
  • Fredrik Sveide
    New Member
    • Nov 2011
    • 6

    #2
    this is my last hope please help mee ?

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      What language is this?

      Comment

      • Fredrik Sveide
        New Member
        • Nov 2011
        • 6

        #4
        i am using objective-c++ in xcode

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          I can't help you, then. I am only familiar with ANSI C++ and various extensions thereunto. Sorry.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            You didn't close your function.

            Comment

            • Fredrik Sveide
              New Member
              • Nov 2011
              • 6

              #7
              but its the same problem even when i close it ?

              Comment

              • Fredrik Sveide
                New Member
                • Nov 2011
                • 6

                #8
                if it helps. the program says that it is the first line that is strugling.

                Comment

                • weaknessforcats
                  Recognized Expert Expert
                  • Mar 2007
                  • 9214

                  #9
                  The compiler knew it was in trouble when it got to the {.

                  That means your error is before the {. Maybe it's before the code you posted. Like maybe you forgot a } before you coded the { that you posted.

                  Comment

                  • Fredrik Sveide
                    New Member
                    • Nov 2011
                    • 6

                    #10
                    thanks alot man :)

                    I APPRECIATE it :)

                    Comment

                    Working...