Re: NSSound and private embedded frameworks
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