TIP: How to find the full URL of a file within your Application’s Bundle

iPhone Icon 79 x 130This is an iPhone Programming tip. Say you want to find  the full URL of a file within your Application’s Bundle (mainBundle), here’s how you would do it. Example: This would return the full URL of a file named “Sound2.caf”:

CFURLRef fileURL;
NSString *path;
path = [[NSBundle mainBundle] pathForResource:@"Sound2" ofType:@"caf"];
fileURL = (CFURLRef)[NSURL fileURLWithPath:path];


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *