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];
}
/오류 : 예상 표현 '다른'이전