IOS Application resource management tutorial

Source: Internet
Author: User

IOS application resourcesThe management tutorial is the content to be introduced in this article. In ios development, you often need to deploy some resource files, such as videos, audios, and images.IosDevice, but by default, the system willResourcesCopy all to the mainBundle folder) directory, even if your resources are organized by folder.

This problem is obvious when using ArcGIS API for iOS to load offline cache images, because all cache images are organized according to classification rules, if you copy all the images to the mainBundle directory, many images may have the same name and cannot be read according to the folder rules. Therefore, you need to manage the images in folders under the mainBundle directory.

To solve this problem, you only need to drag the resource folder to be copied to the xcode project. for example, a dialog box is displayed, which is "recursively create groups for any add folders" by default ", select the following item "create folder references for any added folders" and click add ,:



After adding the resource, you can see in xocde that the corresponding resource folder is blue instead of yellow, such:

In this way, when we use [[NSBundle mainBundle] pathForResource: fileName ofType: @ "jpg" inDirectory: dir];, we can get the relevant files through the folder path. Note: Do not add files using group or add exist file. Otherwise, you cannot obtain the desired file using the pathForResource method.

Summary:IOS application resourcesI hope this article will help you with the introduction of the management tutorial!

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.