3. Use NSBundle and plist in ios, 3. iosnsbundle
1. NSBundle
1> An NSBundle represents a folder, and the NSBundle can be used to access the corresponding folder.
2> Use mainBundle to access any resources in the Software Resource Package
3> Simulator Application installation path/Users/aplle/resource library/Application Support/iPhone Simulator/7.1/Applications
4> implement lazy loading only once
@ Property (nonatomic, strong) NSArray * imageData;-(NSArray *) imageData {if (_ imageData = nil) {// never initialized // initialize data // File: full path // NSBundle: A NSBundle represents a folder // use mainBundle to access any resources in the software resource package NSBundle * bundle = [NSBundle mainBundle]; // obtain imageData. plist full path NSString * path = [bundle pathForResource: @ "imageData" ofType: @ "plist"]; _ imageData = [NSArray arrayWithContentsOfFile: path];} return _ imageData ;}
2. Use of plist files based on poor scalability
* Create a plist
* Let plist load only once