• 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
Re: NSSound and private embedded frameworks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSound and private embedded frameworks


  • Subject: Re: NSSound and private embedded frameworks
  • From: Clark Cox <email@hidden>
  • Date: Tue, 3 Jan 2006 06:19:37 -0500

2006/1/3, Philip Dow <email@hidden>:
> Boisy, you may want to try the following.
>
> First, get the NSBundle object for your framework using :
>
>         NSBundle *myFrameworkBundle = [NSBundle
> bundleWithIdentifier:@"com.myframework.name"];
>
> Then get the path to the sound file using
>
>         NSString *soundPath = [myFrameworkBundle
> pathForResource:@"MySoundName" ofType:@"wav"];

A better idea would be to use:

NSString *soundPath = [myFrameworkBundle pathForSoundResource: @"MySoundName"];

That way, it will work even if the file's format/type is changed (to
aiff, mp3, whatever)

>
> Make sure the sound file ends in the .wav extension. That sound path
> should be a complete path whether using the framework or the
> application. Use that path to initialize your NSSound object - (id)
> initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef

--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSSound and private embedded frameworks (From: Boisy Pitre <email@hidden>)
 >Re: NSSound and private embedded frameworks (From: Philip Dow <email@hidden>)

  • Prev by Date: Re: NSSound and private embedded frameworks
  • Next by Date: Re: NSMatrix NSImageCell binding
  • Previous by thread: Re: NSSound and private embedded frameworks
  • Next by thread: setImageInterpolation:NSImageInterpolationNone ignored when dataWithPDFInsideRect: called
  • Index(es):
    • Date
    • Thread