Use of 3.ios NSBundle and plist

Source: Internet
Author: User

1.nsbundle

1 > a NSBundle represents a folder , Use NSBundle access to the corresponding folder

2 > Use Mainbundle can access any resource in the software resource bundle

3 > installation path of the emulator application /users/aplle/ repository /application support/iphone simulator/7.1 /applications

4> implement lazy loading load only once

@property (nonatomic, Strong) Nsarray *imagedata;-(Nsarray *) imagedata{    if (_imagedata = = nil) {//never initialized        //initialized number According        to//File: Full path        //NSBundle: A nsbundle represents a folder        //use Mainbundle to access any resource in the software resource bundle        nsbundle *bundle = [ NSBundle Mainbundle];  get Imagedata.plist's full path        nsstring *path = [Bundle pathforresource:@ "ImageData" oftype:@ "plist"];                _imagedata = [Nsarray Arraywithcontentsoffile:path];    }    return _imagedata;}

2.based on poor extensibilityplistUse of files

* Create plist

* Let plist load only once



Use of 3.ios NSBundle and plist

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.