NSBundle

Link URL:http://hi.baidu.com/xtianhe/blog/item/1f1bbe1cbd4c411f35fa41a6.html

NSBundle的对象可以获取应用程序安装目录的附件。

附件包括了,当前应用程序下,所有的文件。(图片、属性列表等) 

获取XML文件

NSString *filePath = [[NSBundle mainBundle] pathForResouse:@"re" ofType:@"xml"];
 
NSData *data = [[NSData alloc] initWithContentsOfFile:filePath];

获取属性列表

NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"ViewControllers" ofType:@"plist"]];

原文地址:https://www.cnblogs.com/xingchen/p/2097856.html