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!