Cocoaはさっぱり!!! Version.3
■ このスレッドは過去ログ倉庫に格納されています
0086名称未設定
03/10/31 18:27ID:3z9Nfggrこんな感じで。
aSound と repeat はインスタンス変数。
-(IBAction)play:(id)sender{
[aSound release];
aSound=[[NSSound alloc] initWithContentsOfFile:@"/System/Library/Sounds/Glass.aiff" byReference:YES];
[aSound setDelegate:self];
repeat=YES;
[aSound play];
}
-(IBAction)stop:(id)sender{
repeat=NO;
}
-(void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool{
if (repeat) [aSound play];
}
■ このスレッドは過去ログ倉庫に格納されています