【代码笔记】iOS-plist获得城市列表
2024-09-12 18:09:04
一,工程图。
二,代码。
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. NSString* cityPlistPath = [[NSBundle mainBundle] pathForResource:@"cities" ofType:@"plist"]; //按照拼写排序,spell是英文拼写
NSSortDescriptor *bySpell = [NSSortDescriptor sortDescriptorWithKey:@"spell" ascending:YES];
NSArray *cities = [[NSArray arrayWithContentsOfFile:cityPlistPath] sortedArrayUsingDescriptors:@[bySpell]];
NSLog(@"--cities--%@",cities); }
最新文章
- 我的MYSQL学习心得(十五) 日志
- urlMappings与URL映射
- HTTP请求常见状态码
- iOS YSKit系列
- php目录文件下有php-ini-development和php.ini-production。
- WebConfig自定义节点并读取
- 转载Worktile 技术架构概要
- json的引号之伤
- liteUploader上传控件的封装使用
- CentOS 7 安装phpredis和redis(接上一篇centos7安装lnmp)
- github使用步骤
- 骚气男孩saochi boy 唐砖 插曲
- shell變量和數組
- RESTful记录-RESTful服务
- C# 将 Json 解析成 DateTable
- gdb 内存查看
- MySQL Windows 安装与配置
- 分析org.rpgpoet.Music.wizards.length
- 洛谷P1592 互质
- charles抓取https中出现unknow
热门文章
- golang 切片和数组在for...range中的区别
- Oracle 获取本周、本月、本季、本年的第一天和最后一天
- Android初识Helloworld
- linux下的进程(孤儿进程、僵尸进程)
- python获取动态网站上面的动态加载的数据(初级)
- AsyncTask实现网络图片的异步加载
- Chapter 3 Phenomenon——22
- 高可用Hadoop平台-答疑篇
- 轻量级web富文本框——wangEditor使用手册(2)——扩展一个“缩进”功能 demo
- python 生成唯一识别码