simple(?) NSSound selector not recognized error
simple(?) NSSound selector not recognized error
- Subject: simple(?) NSSound selector not recognized error
- From: Russ McBride <email@hidden>
- Date: Tue, 14 Aug 2007 20:55:13 -0700
In my header file I've got:
NSSound *theSound;
And in my implementation file I've got a couple of methods, each called from a button click:
- (IBAction)lightning:(id)sender { NSString *soundFile = [[NSBundle mainBundle] pathForResource:@"lightning" ofType:@"au"]; NSSound *theSound = [[NSSound alloc] initWithContentsOfFile:soundFile byReference:YES]; [theSound play]; // [theSound pause] This works just fine if called here.
}
- (IBAction) pauseSound:(id)sender { [theSound pause]; [infoTextField setStringValue:@"Playback paused"]; }
I've got a "pause" button that's connected to the "pauseSound" method. The sound plays fine, but I can't pause, resume, or stop the sound in another method. I get the following error:
SoundFun[15316] *** -[NSPathStore2 pause]: selector not recognized [self = 0x3466e0]
I checked the retainCount and theSound isn't being deallocated prematurely.
Any tips appreciated.
Thanks, russ
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden