开发者

Objective-c image loading problem. Problem is relative/absolut path

开发者 https://www.devze.com 2023-02-11 07:10 出处:网络
I\'m trying to show an image to the screen but the provider provider = CGDataProviderCreateWithFilename(filename);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消