iOS-NSBundle、NSArray、NSDictionay
2024-09-07 18:33:13
NSBundle、NSArray、NSDictionay
读取plist文件
NSDictionary *dict= [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"fileName" ofType:@"plist"]];
NSArray*arr=[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"fileName" ofType:@"plist"]];
读取后缀为.bundle的文件
NSString *bundlePath = [[[NSBundle mainBundle]bundlePath]stringByAppendingPathComponent:@"xx.bundle"];
NSBundle *bundle = [NSBundle bundleWithPath:bundlePath];
NSString *path = [bundle pathForResource:imageName ofType:@"png"];
UIImage *image=[UIImage imageWithContentsOfFile:path];
NSString *path = [[NSBundle mainBundle]pathForResource:@"xx" ofType:@”plist”];
NSURL *url = [[NSBundle mainBundle] pathForResource:@"xx " ofType:@"plist"];
最新文章
- 工作中总结的常用PHP代码
- WinForm窗体嵌入
- DOM(九)使用DOM设置文本框
- C#学习笔记思维导图 一本书22张图
- Swift学习(四)常量&;变量&;基础数据类型
- 【BZOJ】【1022】【SHOI2008】小约翰的游戏John
- mysql_insert_id 为什么会返回空值
- UVALive 3027 并查集
- 整理一些提高C#编程性能的技巧
- MySQL数据库— 汇总和分组数据
- Java中的方法
- 配置linux软件下载跟新地址
- Python:怎样用线程将任务并行化?
- 深入JVM分析spring-boot应用hibernate-validator
- BZOJ2300[HAOI2011]防线修建——非旋转treap+凸包(平衡树动态维护凸包)
- 【python】命令行神器 Click 简明笔记
- JSOUP如何POST只含JSON格式的数据
- What is the difference between concurrency, parallelism and asynchronous methods?
- Android Handler 消息处理使用
- Python入门-散点图绘制
热门文章
- 如何在C中传递二维数组作为参数?
- oracle数据库中 impdb/expdb 详解
- Educational Codeforces Round 75 (Rated for Div. 2) C. Minimize The Integer
- ADB命令使用详解
- PHP实现多文件上传的一些简单方法
- Linux 查看实时网卡流量的几种方式
- Gym - 102346G Getting Confidence 最小费用最大流
- (7)打造简单OS-加载内核
- win10下交换CapLock和Esc按键
- CF1188B Count Pairs