• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSound


  • Subject: NSSound
  • From: Steve Mills <email@hidden>
  • Date: Wed, 6 Nov 2002 20:32:26 -0600

This works:

NSSound* snd = [NSSound alloc];

[snd retain];
[snd initWithContentsOfFile: fileName byReference: NO];
[snd play];

But this doesn't:

NSMutableData* data = [[NSMutableData dataWithContentsOfFile: fileName] retain];
NSSound* snd = [[NSSound alloc] retain];

[snd initWithData: data];
[snd play];

The first [snd play] returns YES but the second returns NO. If it's the same data, why does only the first method work? I even tried naming the sound in the second method.

And while I'm here, is there a way to display memory of a variable while debugging with Project Builder like you can with CodeWarrior's Display Memory menu item? Displaying variables in PB is woefully inadequate.

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSSound
      • From: Sherm Pendley <email@hidden>
    • Re: NSSound
      • From: Finlay Dobbie <email@hidden>
    • Re: NSSound
      • From: Ondra Cada <email@hidden>
  • Prev by Date: [OT] iNet Unix Tools on OS X
  • Next by Date: undocumented "NSNibOwning" informal protocol?
  • Previous by thread: [OT] iNet Unix Tools on OS X
  • Next by thread: Re: NSSound
  • Index(es):
    • Date
    • Thread