Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

neil.b

macrumors member
Original poster
Nov 20, 2008
65
0
Hi,

I'm trying to make a simple sound player for my application and am having trouble getting the URL of files using CFBundleCopyResourceURL.

My app (so far) consists of a delegate and a view controller plus my own custom class for a sound object (just a NSObject that will play sounds). My view controller instantiates the sound object.

If try to load sounds in the sound object with CFBundleCopyResourceURL (to get the sound file URL) it returns NULL. If I move the code (to get the sound file URLs) to my view controller, it works.

The only way I can get the sound object to load the sounds is to have the view controller get the URL with CFBundleCopyResourceURL and then pass the resource URL to the sound object, which is messy as I'd rather have the sound object take care of all of it's loading needs.

Is there a scope/access issue with CFBundleCopyResourceURL? It's driving me mental!

Thanks,

Neil
 

neil.b

macrumors member
Original poster
Nov 20, 2008
65
0
Sorted it.

I'd renamed one of the files and it seems Xcode hadn't internally recognised that it had changed. Removed the resource and re-added it to the project.

Odd, but it works now. :rolleyes:
 

wizard

macrumors 68040
May 29, 2003
3,854
571
XCode is very buggy!

Not to flame the thread but XCode is very buggy. I've had to reinstall once to eliminate a very strange issue. Thing improve slowly but the latest release seems to be a bit better. In any event I've had issues with Python editting, recognition of files, crashes, script handling and other stuff.

I hate to say this but XCode is a good example of the general decline in Apples software quality. I do wish they would get their act together. Hopefully Steve is talking straight when he says that is part of the goals for Snow Leopard!



Dave
 

neil.b

macrumors member
Original poster
Nov 20, 2008
65
0
I'm beginning to realise that :(

Thanks for the input - at least I know I'm not going totally mad. :)
 

priyank.ranka

macrumors member
Jun 11, 2008
51
0
Is there any way through which i can store the sound in application to the phone and also use it as ringtone. Thanx for the advice in advance, will look forward for ur advices...i really got stuck with this issue for my release.
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
The iPhone SDK builds of xCode used to crash randomly a bit too often for my liking but it does seem to have got quite a bit better on the 2.2 releases - at least for me. Some things still seem to be part science part voodoo though:rolleyes:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.