MacProgramer
Nov 26, 2008, 10:11 PM
ok i am currently teaching myself how to develop for Leopard
(Cocoa + Objective-C)
i need help with a program using the NSSound Class
here is the code
#import "AppController.h"
@implementation AppController
- (IBAction)playMusic:(id)sender
{
NSSound* sound = [[NSSound alloc] initWithContentsOfFile: @"/Users/HomePortal/Music/TI - Whatever You Like.mp3" byReference:YES];
[sound play];
}
- (IBAction)stopMusic:(id)sender
{
}
@end
how do i get the action stopMusic: to stop the music when i press the button linked to the action stopMusic:
, any help would be appreciated
(Cocoa + Objective-C)
i need help with a program using the NSSound Class
here is the code
#import "AppController.h"
@implementation AppController
- (IBAction)playMusic:(id)sender
{
NSSound* sound = [[NSSound alloc] initWithContentsOfFile: @"/Users/HomePortal/Music/TI - Whatever You Like.mp3" byReference:YES];
[sound play];
}
- (IBAction)stopMusic:(id)sender
{
}
@end
how do i get the action stopMusic: to stop the music when i press the button linked to the action stopMusic:
, any help would be appreciated
