Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 03-30-2009, 09:22 PM   #1 (permalink)
FailDev xD
 
Join Date: Mar 2009
Posts: 64
PolishDemon is on a distinguished road
Send a message via AIM to PolishDemon
Default Play Short Sound Help...

Hey thurr...first post and I'm in need of some help. I've basically rewritten Nitrex88's code in his tut for playing a short sound...but I'm getting errors and I can't determine where they are located...any help would be greatly appreciated.

MainView.h
Code:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@class SoundEffect;

@interface MainView : UIView {
    IBOutlet UIImageView *whoopeeImage;
	SoundEffect *soundEffect;
}

@end
MainView.m
Code:
#import "MainView.h"
#import "SoundEffect.h"

@implementation MainView

-(void)awakeFromNib {
	NSBundle *mainBundle = [NSBundle mainBundle];
	soundEffect = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"fart" ofType:@"mp3"]];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
	[soundEffect play];
}

@end
SoundEffect.h
Code:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioServices.h>

@interface SoundEffect : NSObject {
	SystemSoundID soundID;
}

- (id)initWithContentsOfFile(NSString *)path;
-(void)play;

@end
SoundEffect.m
Code:
#import "SoundEffect.h"


@implementation SoundEffect

- (id)initWithContentsOfFile(NSString *)path
{
	self = [super init];
	if (self != nil) { 
		NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
		AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
	}
	return self;
}
-(void)play{
	AudioServicesPlaySystemSound(soundID);
}


@end
Most errors are in the SoundEffect.m file...mostly syntax errors...and a warning: control reaches end of non-void function in the SoundEffect.m

Also in the MainView.m I get a syntax error, but only after I did #import "SoundEffect.h", which idk if that is necessary or not, but that leads me to believe something is wrong in the SoundEffect.h file. Any help is greatly appreciated. Thanks!

EDIT: I forgot to add...I'm getting an odd error: 'path' undeclared (first use in this function) error goin on...

-PolishDemon

Last edited by PolishDemon; 03-30-2009 at 09:25 PM.
PolishDemon is offline   Reply With Quote
Old 03-30-2009, 09:25 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 92
ipodgreatmaster is on a distinguished road
Default

Please tell us what errors give xcode. Do you need to add a framework?
__________________
Independent developer
Please excuse me by my bad english. English is not my native language

Sabius Software
Link To App Store

ipodgreatmaster is offline   Reply With Quote
Old 03-30-2009, 09:29 PM   #3 (permalink)
FailDev xD
 
Join Date: Mar 2009
Posts: 64
PolishDemon is on a distinguished road
Send a message via AIM to PolishDemon
Default

The errors given by XCode are the following:
error: syntax error before '(' token
error: syntax error before '(' token
error: 'path' undeclared (first use in this function)
warning: control reaches end of non-void function

Those are in SoundEffect.m

In MainView.m, I also get an error: syntax error before '(' token
PolishDemon is offline   Reply With Quote
Old 03-31-2009, 05:11 AM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Location: Newcastle, UK
Posts: 8
Scottio200 is on a distinguished road
Send a message via AIM to Scottio200 Send a message via MSN to Scottio200 Send a message via Skype™ to Scottio200
Default

just another note on this, you seem to have mp3 as file format.

What i found is that the simulator will play the file, but the device will not play the sound.

Cheers
Scottio
Scottio200 is offline   Reply With Quote
Old 04-01-2009, 07:24 PM   #5 (permalink)
FailDev xD
 
Join Date: Mar 2009
Posts: 64
PolishDemon is on a distinguished road
Send a message via AIM to PolishDemon
Default

BUMP

Anyone got any help for me? I really wanna know why this isn't working, I'm not giving up till I get an answer, and I can't figure it out by myself =[
PolishDemon is offline   Reply With Quote
Old 04-01-2009, 07:44 PM   #6 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,176
Kalimba is on a distinguished road
Default

Quote:
Originally Posted by PolishDemon View Post
SoundEffect.h
Code:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioServices.h>

@interface SoundEffect : NSObject {
	SystemSoundID soundID;
}

- (id)initWithContentsOfFile:(NSString *)path; // <== add the missing colon (:) character
-(void)play;

@end
SoundEffect.m
Code:
#import "SoundEffect.h"


@implementation SoundEffect

- (id)initWithContentsOfFile:(NSString *)path // <== add the missing colon (:) character
{
	self = [super init];
	if (self != nil) { 
		NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
		AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
	}
	return self;
}
-(void)play{
	AudioServicesPlaySystemSound(soundID);
}


@end
Most errors are in the SoundEffect.m file...mostly syntax errors...and a warning: control reaches end of non-void function in the SoundEffect.m

Also in the MainView.m I get a syntax error, but only after I did #import "SoundEffect.h", which idk if that is necessary or not, but that leads me to believe something is wrong in the SoundEffect.h file. Any help is greatly appreciated. Thanks!

EDIT: I forgot to add...I'm getting an odd error: 'path' undeclared (first use in this function) error goin on...

-PolishDemon
Quote:
Originally Posted by PolishDemon View Post
BUMP

Anyone got any help for me? I really wanna know why this isn't working, I'm not giving up till I get an answer, and I can't figure it out by myself =[
Make the fixes I've highlighted in RED above. Note that the compiler isn't very specific, but it IS telling you exactly what the problem is here. Let us know how that goes.
Kalimba is offline   Reply With Quote
Old 04-01-2009, 08:24 PM   #7 (permalink)
FailDev xD
 
Join Date: Mar 2009
Posts: 64
PolishDemon is on a distinguished road
Send a message via AIM to PolishDemon
Default

Kalimba thank you so much! Such a noob mistake, I cannot believe I missed that =[

Now on to further beginning development of apps to see how this turns out!

Thank you yet again, I appreciate it so much!

-PolishDemon
PolishDemon is offline   Reply With Quote
Old 04-23-2009, 08:41 PM   #8 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 2
TheTerminator is on a distinguished road
Default

I get failed to build, I always have followed that tutorial and I have used the same codes in the corrections. I get the following errors:

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o

and then

"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o
symbol(s) not found
collect2: ld returned 1 exit status
TheTerminator is offline   Reply With Quote
Old 04-23-2009, 09:47 PM   #9 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,176
Kalimba is on a distinguished road
Default

Quote:
Originally Posted by TheTerminator View Post
I get failed to build, I always have followed that tutorial and I have used the same codes in the corrections. I get the following errors:

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o

and then

"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o
symbol(s) not found
collect2: ld returned 1 exit status
Looks like you're missing a required framework in your project. I haven't seen the tutorial, so I don't know what it says about adding frameworks.
Kalimba is offline   Reply With Quote
Old 04-23-2009, 10:00 PM   #10 (permalink)
FailDev xD
 
Join Date: Mar 2009
Posts: 64
PolishDemon is on a distinguished road
Send a message via AIM to PolishDemon
Default

Quote:
Originally Posted by TheTerminator View Post
I get failed to build, I always have followed that tutorial and I have used the same codes in the corrections. I get the following errors:

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o

and then

"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o
symbol(s) not found
collect2: ld returned 1 exit status
Yeah make sure u add the following framework: AudioToolbox.framework

And then to implement them do the following:
#import <AudioToolbox/AudioServices.h> which goes in the SoundEffect.h file...

That should help u a little bit.
PolishDemon is offline   Reply With Quote
Old 04-24-2009, 09:45 PM   #11 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 2
TheTerminator is on a distinguished road
Default

I've already had these things in my SoundEffect.h and I've already added the AudioToolbox.framework and I still get the errors.
TheTerminator is offline   Reply With Quote
Old 04-29-2009, 03:49 PM   #12 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 79
carlandrews is on a distinguished road
Default sound file when changed not playing

My "aif" sound file plays fine in my app but if I try to change and program the app to play a different sound file or even overwrite the current sound file with a newer version, it no longer plays? Lucky I keep a back-up because when I put the one that was working back, it still no longer plays so I go back to the back-up.

I hope someone can help, it's driving me crazy
Thanks,
Carl

/*
File: SysSoundViewController.m
*/

#import "SysSoundViewController.h"

@implementation SysSoundViewController


- (void) viewDidLoad {
[super viewDidLoad];

// Get the main bundle for the app
NSString *path = [[NSBundle mainBundle] pathForResource:@"tap" ofType:@"aif"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPathath], &soundID);
}

// Respond to a tap on the System Sound button
- (IBAction) playSystemSound {

AudioServicesPlaySystemSound (soundID);




UIImage *myImage1 =
[UIImage imageNamed:@"mouth1.png"] ;
UIImage *myImage3 =
[UIImage imageNamed:@"mouth3.png"] ;
UIImage *myImage4 =
[UIImage imageNamed:@"mouth4.png"] ;

UIImageView *myImageView =
[[UIImageView alloc]
initWithFrame : [[UIScreen
mainScreen] bounds]] ;

myImageView.animationImages =
[NSArray arrayWithObjects:myImage1,myImage3,myImage4,nil];

myImageView.animationDuration = .7;
myImageView.animationRepeatCount = 6;

[myImageView startAnimating];
[self.view addSubview:myImageView];
[myImageView release];



}

- (void) dealloc {

[SysSoundViewController release];

[super dealloc];
}



@end
carlandrews is offline   Reply With Quote
Old 05-14-2009, 09:49 AM   #13 (permalink)
New Member
 
Join Date: May 2009
Posts: 5
gorgonzola2000 is on a distinguished road
Default

at first i want to thank the creator for the great tutorial.
i am almost through it, but there is an error message i cant solve

error: 'isDirectory' undeclared (first use in this function)
error: syntax error before ':' token

SoundEffect.m
Quote:
#import "SoundEffect.h"


@implementation SoundEffect

- (id) initWithContentsOfFileNSString *)path
{
self = [super init];
if (self != nil) {
NSURL *filePath = [NSURL fileURLWithPathath [isDirectory:NO];
//ERROR MESSAGES ARE DISPLAYED HERE
AudioServicesCreateSystemSoundID((CFURLRef)filePat h, &soundID);
}
return self;
}

-(void)play {
AudioServicesPlaySystemSound(soundID);
}

@end

and MainView.m is saying
warning: receiver 'SoundEffect' is a forward class and corresponding @interface may nocht exist
Quote:
-(void)awakeFromNib {
NSBundle *mainBundle = [NSBundle mainBundle];
soundEffect = [[SoundEffect alloc] initWithContentsOfFile:[mainBundle pathForResource:@"katze" ofType:@"mp3"]];

Last edited by gorgonzola2000; 05-14-2009 at 09:59 AM.
gorgonzola2000 is offline   Reply With Quote
Old 05-14-2009, 10:40 AM   #14 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,176
Kalimba is on a distinguished road
Default

Quote:
Originally Posted by gorgonzola2000 View Post
at first i want to thank the creator for the great tutorial.
i am almost through it, but there is an error message i cant solve

error: 'isDirectory' undeclared (first use in this function)
error: syntax error before ':' token

SoundEffect.m



and MainView.m is saying
warning: receiver 'SoundEffect' is a forward class and corresponding @interface may nocht exist
The error is caused by an extra bracket on that line:
Code:
#import "SoundEffect.h"


@implementation SoundEffect

- (id) initWithContentsOfFileNSString *)path
{
self = [super init];
if (self != nil) {
NSURL *filePath = [NSURL fileURLWithPathath [isDirectory:NO]; //ERROR MESSAGES ARE DISPLAYED HERE
//                                          ^ this bracket should be removed
AudioServicesCreateSystemSoundID((CFURLRef)filePat h, &soundID);
}
return self;
}

-(void)play {
AudioServicesPlaySystemSound(soundID);
}

@end
The other warning is probably happening because you've omitted the #import "SoundEffect.h" in MainView.m.
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 05-14-2009, 12:13 PM   #15 (permalink)
New Member
 
Join Date: May 2009
Posts: 5
gorgonzola2000 is on a distinguished road
Default

i ve checked the code about 1000 times... didnt see it!
thank you very much!

after deleting the bracket, my errors were solved. but now i am receiving the following message:

but, now i ve got a new error

Quote:
Building target “test” of project “test” with configuration “Debug” — (2 errors)

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o
"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (2 errors)

Last edited by gorgonzola2000; 05-14-2009 at 01:11 PM.
gorgonzola2000 is offline   Reply With Quote
Old 05-14-2009, 01:31 PM   #16 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,176
Kalimba is on a distinguished road
Default

Quote:
Originally Posted by gorgonzola2000 View Post
i ve checked the code about 1000 times... didnt see it!
thank you very much!

after deleting the bracket, my errors were solved. but now i am receiving the following message:

but, now i ve got a new error
You're missing a framework in the project. I'm not sure which framework, though. What does the tutorial say you should do?
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 05-14-2009, 01:48 PM   #17 (permalink)
New Member
 
Join Date: May 2009
Posts: 5
gorgonzola2000 is on a distinguished road
Default

Quote:
Originally Posted by Kalimba View Post
You're missing a framework in the project. I'm not sure which framework, though. What does the tutorial say you should do?
you have to import the "AudioToolbox.framework". that's all.

Welcome to the iPhone Development Central Website!

this is the tutorial. he is saying at 14:33 that a pointer is needed. to avoid this, you have to use '&'
maybe this is the problem?

SoundEffect.m
Quote:
@implementation SoundEffect

- (id) initWithContentsOfFileNSString *)path
{
self = [super init];
if (self != nil) {
NSURL *filePath = [NSURL fileURLWithPathath isDirectory:NO];
AudioServicesCreateSystemSoundID((CFURLRef)filePat h, *&soundID); *pointer needed
}
return self;
}
SoundEffect.h
Quote:
@interface SoundEffect : NSObject {
SystemSoundID soundID;
}
gorgonzola2000 is offline   Reply With Quote
Old 05-16-2009, 06:58 PM   #18 (permalink)
IPOD Training Wheels
 
Join Date: May 2009
Location: Seattle WA
Age: 47
Posts: 21
RodOfIPOD is on a distinguished road
Default

Quote:
Originally Posted by TheTerminator View Post
I get failed to build, I always have followed that tutorial and I have used the same codes in the corrections. I get the following errors:

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o

and then

"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o
symbol(s) not found
collect2: ld returned 1 exit status


I get something very very similar when compiling successfully on the simulator but not on the ipod touch:

Code:
"_AudioServicesCreateSystemSoundID", referenced from:
-[SoundEffect initWithContentsOfFile:] in SoundEffect.o

"_AudioServicesDisposeSystemSoundID", referenced from:
-[SoundEffect dealloc:] in SoundEffect.o

"_AudioServicesPlaySystemSound", referenced from:
-[SoundEffect play] in SoundEffect.o
symbol(s) not found
collect2: ld returned 1 exit status
I selected and dragged the SoundEffect.h and m file from the GLPaint application to my own. Do i need to setup any special linkage when i do this?

After copying i added my code and "#import SoundEffect.h" to my .m file.

I have

Code:
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioServices.h>
at the beginning of the SoundEffect.h file but nowhere else.

i also have "AudioToolbox.framework" installed however i don't know if it is PROPERLY installed. I just opened and dragged it into my linked frameworks folder.

Any help would be appreciated.


Now i have removed everything but the SoundEffect.h and SoundEffect.m files and STILL it does the same thing even though i am not even calling these routines?? I continue to endeavor!

and NOW i removed both of those 2 files and it finally compiles both on the simulator and the ipod touch so... what am i missing about copying those 2 files into my application folders?

Very very weird ok i removed everything and then added this to my file:

at the top
Code:
#import <AudioToolbox/AudioServices.h>
when i needed it
Code:
SystemSoundID aSound;  
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:
  [[NSBundle mainBundle] pathForResource:@"MySound" ofType:@"wav"]], &aSound);  
    AudioServicesPlaySystemSound (aSound);
and i still get these errors:

"_AudioServicesCreateSystemSoundID", referenced from:
"_AudioServicesPlaySystemSound", referenced from:
ld: symbol(s) not found
collect2: ld returned 1 exit status

for the files i call them in....and yet it still compiles just fine in the simulator... Any ideas??

in all cases i am using the latest 2.2.1


Thanks!

Last edited by RodOfIPOD; 05-16-2009 at 08:20 PM.
RodOfIPOD is offline   Reply With Quote
Old 05-18-2009, 03:37 PM   #19 (permalink)
New Member
 
Join Date: May 2009
Posts: 5
gorgonzola2000 is on a distinguished road
Default

i ve solved my problem.
as kalimba said, i had a problem with my framework. it wasn't imported correctly.

while importing, you re able to copy it to the projects folder (1st checkbox). dont do this. i had to delete it from my projects folder and import it again...

and it was fixed. works fine now.


so thanks to everyone


/edit
arghs... now i am looking for a tutorial which shows me, how to play different sounds at different images. are there any around?

Last edited by gorgonzola2000; 05-18-2009 at 03:48 PM.
gorgonzola2000 is offline   Reply With Quote
Old 05-23-2009, 11:09 AM   #20 (permalink)
IPOD Training Wheels
 
Join Date: May 2009
Location: Seattle WA
Age: 47
Posts: 21
RodOfIPOD is on a distinguished road
Default

Quote:
Originally Posted by gorgonzola2000 View Post
i ve solved my problem.
as kalimba said, i had a problem with my framework. it wasn't imported correctly.

while importing, you re able to copy it to the projects folder (1st checkbox). dont do this. i had to delete it from my projects folder and import it again...

and it was fixed. works fine now.


so thanks to everyone


/edit
arghs... now i am looking for a tutorial which shows me, how to play different sounds at different images. are there any around?
Ty i had same issue. Key is to use the Add Existing Frameworks and dont drag them into the folder because then it wont LET you copy.
RodOfIPOD is offline   Reply With Quote
Old 06-10-2009, 12:01 PM   #21 (permalink)
New Member
 
Join Date: Mar 2009
Location: Newcastle, UK
Posts: 8
Scottio200 is on a distinguished road
Send a message via AIM to Scottio200 Send a message via MSN to Scottio200 Send a message via Skype™ to Scottio200
Default

I am getting problems when trying to run the application. No compile errors but when the app launches it crashes out instantly. In console im getting the following error

Code:
2009-06-10 17:57:17.790[88937:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:isDirectory:]: nil string parameter'
2009-06-10 17:57:17.792[88937:20b] Stack:
If i comment out the NSRUL initFileURLWithPath line of code from SoundEffect.m the app launches but i get no sound at all.

I have tried to remove the Audiotoolbox framework and re add it several times but getting the same issue

Worst thing is i have another app with exactly the same code in it and that works fine

any ideas?
Scottio200 is offline   Reply With Quote
Old 06-10-2009, 01:20 PM   #22 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

>' [NSURL initFileURLWithPath:isDirectory:]: nil string parameter '

The path you're passing into initFileURLWithPath: is nil; that is, it is nothing. This happens when you ask the system for a path to a file, and the system can't find that file.

How are you building that path? If you're looking for a resource that's included in your project (not downloaded at runtime) It should be something like this:

Code:
NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:nil];
__________________

Free Games!

Last edited by smasher; 06-10-2009 at 01:40 PM.
smasher is offline   Reply With Quote
Old 06-10-2009, 01:31 PM   #23 (permalink)
New Member
 
Join Date: Mar 2009
Location: Newcastle, UK
Posts: 8
Scottio200 is on a distinguished road
Send a message via AIM to Scottio200 Send a message via MSN to Scottio200 Send a message via Skype™ to Scottio200
Default

Quote:
Originally Posted by smasher View Post
>' [NSURL initFileURLWithPath:isDirectory:]: nil string parameter '

The path you're passing into initFileURLWithPath: is nil; that it, it is nothing. This happens when you ask the system for a path to a file, and the system can't find that file.

How are you building that path? If you're looking for a resource that's included int your project (not downloaded at runtime) It should be something like this:

Code:
NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:nil];
Here is my SoundEffect.m file code

Code:
#import "SoundEffect.h"


@implementation SoundEffect

- (id) initWithContentsOfFile:(NSString *)path
{
	self = [super init];
	if (self != nil) {
		NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:YES];
		AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
	}
	return self;
}
-(void)play {
	AudioServicesPlaySystemSound(soundID);
}


@end
Any ideas?

Cheers
Scottio
Scottio200 is offline   Reply With Quote
Old 06-10-2009, 01:38 PM   #24 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by Scottio200 View Post
Any ideas?
Yeah, you're passing a bad path into the method. If you put a breakpoint in the method you posted, you'll see that "path" is nil (0x0)

How are you building the path? Post the code where you create the path.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 06-10-2009, 01:41 PM   #25 (permalink)
New Member
 
Join Date: Mar 2009
Location: Newcastle, UK
Posts: 8
Scottio200 is on a distinguished road
Send a message via AIM to Scottio200 Send a message via MSN to Scottio200 Send a message via Skype™ to Scottio200
Default

Quote:
Originally Posted by smasher View Post
Yeah, you're passing a bad path into the method. If you put a breakpoint in the method you posted, you'll see that "path" is nil (0x0)

How are you building the path? Post the code where you create the path.

Here is my SoundEffect.h file

Code:
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioServices.h>
#import <Foundation/Foundation.h>


@interface SoundEffect : NSObject {
	SystemSoundID soundID;
	
}
-(id) initWithContentsOfFile:(NSString *)path;
-(void)play;
@end

Thanks
Scottio200 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,696
Threads: 94,138
Posts: 402,957
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0