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 ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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]];
}
回答2:
So after referencing the frameworks programming guide, @codeflakes pointed out that dynamic frameworks aren't possible on iPhone OS. I found this link which looks like it has a static lib that includes a few resources. I downloaded the PlausibleDatabase lib referenced there and did see a couple items in a Resources directory. I think the static lib has to build it's own pseudo-bundle structure to get at those things.