ios NSBundle 程序包路径
来源:互联网 发布:ikev2搭建 ubuntu 编辑:程序博客网 时间:2024/06/12 18:51
- (void)mainBundleTest{
//使用NSBundle获取该应用自包含的指定资源文件路径
NSString *filePath = [[NSBundlemainBundle]pathForResource:@"books"ofType:@"txt"];
//使用指定文件的内容来初始化NSString
NSString *content = [NSStringstringWithContentsOfFile:filePath encoding:NSUTF8StringEncodingerror:nil];
//textLabel.text = content ;
NSLog(@"------%@",content);
}
输出内容:
2015-04-14 10:37:33.413 RTSW[956:43391] ------ssssssss
wwee
mainBundleTest
我爱共产党
0 0
- ios NSBundle 程序包路径
- 【精】iOS 文件操作:沙盒(SandBox)、文件操作(FileManager)、程序包(NSBundle)
- iOS 文件操作:沙盒(SandBox)、文件操作(FileManager)、程序包(NSBundle)
- iOS---NSBundle
- ios NSBundle
- IOS NSBundle
- ios相对路径与绝对路径的转化NSBundle
- ios相对路径与绝对路径的转化NSBundle
- ios相对路径与绝对路径的转化NSBundle
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS开发 [NSBundle mainBundle] 通过pathForResource返回路径为空.
- NSBundle--获取文件路径
- NSBundle--获取文件路径
- NSBundle--获取文件路径
- NSBundle--获取文件路径
- NSBundle 获取资源路径
- NSBundle--获取文件路径
- linux软件安装解决相互依赖问题
- Scala开发教程(3): 进一步Scala
- tomcat配置多端口,多服务
- UML类图几种关系的总结
- 转:openfire遇到的问题(集群 更换ip 乱码)
- ios NSBundle 程序包路径
- UITableViewCell设置行距
- Android高效加载大图、多图解决方案,有效避免程序OOM
- 解決Spring的定時器如何獲取項目的部署路徑
- 帧动画
- Scala开发教程(2): 起步Scala
- python批处理将utf-8格式文件转为gbk格式
- Android working with Volley Library
- Java设计模式之模板方法模式(Template Method)