Package image resources in IOS static library

Source: Internet
Author: User
Problem description:

Recently, I am working on a project and need to create a static library containing image resources. a, but the static library project provided by Apple cannot import image resources. bundle file method. In this way, you also need to use the bundle file in the debugging phase. Every time you update the content of the bundle file, you need to re-compile the bundle project to generate a new bundle file.

Solution:

When there are not many image resources, you can convert the image to a base64 string and store it in static mode. You can use base64 to parse the data and display the data.

Nsstring * stringinbase64 = @ ""; nsdata * imagedata = [base64 Decode: stringinbase64]; imageview. Image = [uiimageimagewithdata: imagedata];

PS: image to base64: http://www.askapache.com/online-tools/base64-image-converter

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.