Objective-c image loading problem. Problem is relative/absolut path
I'm trying to show an image to the screen but the provider
provider = CGDataProviderCreateWithFilename(filename);
doesn't create correctly if I give the relative path of the image:
All classes are in project/Classes/ and ball.png is in project/
if I write: "/Volumes/SAGITTER/Lavoro/Progetti xCode/IVBricker test/ball.png"
I have http://img412.imageshack.us/i/schermata20110217a15482.png/
so provide is correctly created.
If I write "ball.png" I have http://img开发者_Python百科43.imageshack.us/i/schermata20110217a15484.png/
How can I solve? Thank you
You need to provide the path to the image. Include it in your application bundle and use NSBundle
to retrieve the path.
精彩评论