Creating CPTImages from images in xcassets file

↘锁芯ラ 提交于 2019-12-25 11:04:13

问题


So according to this, you have to use imageNamed for loading images now in iOS.

Unfortunately, CPTImage's constructors requires paths for loading images

So something like this: [CPTImage imageForPNGFile:[[NSBundle mainBundle] pathForResource:@"plotsymbol" ofType:@"png"]]

These -pathForResource calls now fail because of asset catalogs.

So.. has anyone been able to do this? Did I miss something?


回答1:


The CPTImage class will include an imageNamed method in a future release. It is available now on the release 2.0 branch. People are using the 2.0 code now but it is unfinished and subject to change in many areas before the final release.



来源:https://stackoverflow.com/questions/20485453/creating-cptimages-from-images-in-xcassets-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!