如何在iphone静态库中包含资源? [英] How to include resources in iphone static library?

查看:104
本文介绍了如何在iphone静态库中包含资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在静态库API中包含文件,数据和图像,这样用户就不需要在项目中手动包含它们。
我看到没有明显的方法可以做到这一点但是有一些黑客或解决方法来实现这个目标吗?

I'd like to include files, data and images in a static library API so the users won't need to include them manually in their project. I see that there isn't obvious way to do it but is there some hack or workaround to achieve this goal ?

推荐答案

您可以尝试使用 -i 命令行参数使用 xxd ,并使用包装函数/方法将数据输入 NSData

You can try to use xxd with the -i command line parameter and use a wrapper function/method that feeds the data into a NSData

- (UIImage*)getMyImage
{
    return [UIImage imageWithData:[NSData dataWithBytes:file_ext 
                                                 length:file_ext_len]];
}

这篇关于如何在iphone静态库中包含资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆