• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
simple(?) NSSound selector not recognized error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: simple(?) NSSound selector not recognized error
      • From: Shawn Erickson <email@hidden>
    • Re: simple(?) NSSound selector not recognized error
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: re-sent: Help: why kAudioUnitSubType_TimePitch can't set ASBD??
  • Next by Date: Re: simple(?) NSSound selector not recognized error
  • Previous by thread: Re: re-sent: Help: why kAudioUnitSubType_TimePitch can't set ASBD??
  • Next by thread: Re: simple(?) NSSound selector not recognized error
  • Index(es):
    • Date
    • Thread