Ios-bundle Resource File Package

Source: Internet
Author: User

1. Bundle file

Bundle file is the resource file package. We organize many pictures, XIB and text files together and package them into a bundle file. facilitates referencing resources within packages in other projects.

The bundle file is static, that is, the resource files that we include into the package are not compiled as a resource bundle. It also means that the bundle package cannot contain executable files. It is only as a resource and is parsed into a specific binary data.

2. Making Bundle files

1. New Bundle Project

    • To create a project named Yooweisourcesbundle (the last bundle file name to generate), note that the bundle defaults to the MacOS system, and the Xcode high version needs to be in the MacOS = Framework & Library option is found under options.

    • Open Xcode, select file----> New---> Project.

      Select MacOS----> Framework & Library---> Bundles.

2. Modify Bundle configuration information

    • Because the Bundle defaults to the MacOS system, you need to modify his information to change to an IOS system.

Set the Build Setting COMBINE_HIDPI_IMAGES to NO, otherwise the image in the Bundle is in TIFF format.

3. Optional configuration

    • As a resource bundle, just need to compile just fine, no need to install the related configuration, set the Skip install to Yes. Also remove the value of the installation path installation Directory.

The PCH file and the strings file for the resource bundle can be deleted.

4. Add Files

    • Drag the resource file or folder below the Sourcesbundle folder in the project.

5. Compile and generate Bundle files

    • We separately choose Generic IOS Device and any one of the emulators compiled once, after compiling, we will see the project in the Products folder Sourcesbundle.bundle from red to black.

Then show in finder and look at the generated files. We see that it generates a. bundle resource file for both the real machine and the simulator.

Select the. bundle file right-click to display the package contents, and we can see the resource files that were previously dragged into the project.

The use of bundles continues tomorrow ...

Ios-bundle Resource File Package

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.