• 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
NSSound 'selector not recognized' error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSound 'selector not recognized' error


  • Subject: NSSound 'selector not recognized' error
  • From: Russ McBride <email@hidden>
  • Date: Thu, 16 Aug 2007 15:31:58 -0700

I'm moving this over from the coreAudio list since it doesn't seem to get too much traffic.

I still can't seem to figure out why I'm getting a "selector not recognized" error when I try to pause a playing sound. When I pause a playing built-in system sound everything works find. But I get the error when I try to pause a sound from a local file.

Any tips appreciated.

Thanks,
russ

================================

interface--
     NSSound *theSound;

implementation--
// Getter and setter methods for theSound instance variable.
- (NSSound *)theSound
{
    return theSound;
}

- (void)setTheSound:(NSSound *)newSound
{
    theSound = newSound;
    [theSound setDelegate:self];
}

// Plays the selected system sound from an NSTableView.
// This can always be paused just fine.
- (IBAction)playSystemSound:(id)sender
{
NSString *selectedSoundAsString = [builtinSounds objectAtIndex: [tableView selectedRow]];
NSSound *selectedSound;
selectedSound = [NSSound soundNamed:selectedSoundAsString];
[self setTheSound:selectedSound];
[theSound play];
}


// Plays a sound the user selects his file system. Generates
// error is pause is attempted.
- (IBAction)playFromLocalFile:(id)sender
{
NSString *theFileName;
// Do stuff to get theFileName set to some local sound file, e.g., an .mp3 file . . .
NSSound *localSound = [[NSSound alloc] initWithContentsOfFile:theFileName byReference:YES];
[self setTheSound:localSound];
[theSound play];
}


// This creates a "selector not found" error when theSound is
// played from the method, playFromLocalFile, then paused, but it doesn't generate an error
// when the sound is played from the method, playSystemSound, then paused.--?????
- (IBAction) pause:(id)sender
{
[theSound pause];
}
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSound 'selector not recognized' error
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: Re: Cocoa Bindings master-detail interface with sets of data in the detail part
  • Next by Date: Re: NSSound 'selector not recognized' error
  • Previous by thread: Re: CoverFlow on 10.4
  • Next by thread: Re: NSSound 'selector not recognized' error
  • Index(es):
    • Date
    • Thread