2011-04-30 4 views
0

소리를 일시 중지하고 재생하는 버튼을 만들고 있습니다. 여기 내 코드입니다 :오류 : 'else'앞에 예상되는 표현

.H :

@interface RootViewController : UIViewController { 
} 
@property (nonatomic, retain) AVAudioPlayer *theAudio; 
-(IBAction)pause; 

@end 

하는 .m : (이미 선언 :

이제
- (void)viewDidLoad { 
    NSString *path = [[NSBundle mainBundle] pathForResource:@"MathMusic1" ofType:@"wav"]; 
    self.theAudio = [[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL] autorelease]; 
    theAudio.delegate = self; 
    [theAudio play]; 
    theAudio.numberOfLoops = -1; 

    [super viewDidLoad]; 


} 

내가 지금 여기를 일시 중지 버튼을 만들려고 노력하고 코딩이다 .H)

-(IBAction)pause { 

    [theAudio pause]; 




    else // expected expression before 'else' 
    [theAudio play]; 

} 

/오류 : 예상 표현 '다른'이전

답변

0

if이없는 else이 있습니다. 코드에 오류가있는 것 같습니다.

0

당신은 if 성명을 가지고 있지 않습니다.

관련 문제