NSDICTIONARY获取内容的CRASH
NSString *path = [self.dataPath stringByAppendingPathComponent:@"dummy.plist"];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
NSString *dummyKeyValue = [dict valueForKey:@"dummyKey"]; // NSLog(@"%@",[NSString stringWithString:dummyKeyValue]); [dict release];http://www.zyxsw.net NSString *anotherString = [dummyKeyValue lowercaseString];
当使用到dummyKeyValue时 挂掉。
背景:
NSDictionary在获得里面的值后, 对Dict进行释放。此时value也全部释放了。 当有引用在使用该value时,就会野指针。
解决办法:
NSString *dummyKeyValue = [[[dict valueForKey:@"dummyKey"] retain] autorelease];
NSDICTIONARY获取内容的CRASH的更多相关文章
- espcms列表页ajax获取内容 - 并初始化swiper
<link rel="stylesheet" href="swiper.min.css" type="text/css" media= ...
- php发送get、post请求获取内容的几种方法
方法1: 用file_get_contents 以get方式获取内容 <?php $url='http://www.domain.com/'; $html = file_get_contents ...
- jquery获取内容和属性的方法
通过jquery如何捕获文本内容和属性? text(),html(),val()及attr(). attr()更具有普遍性,元素text属性和表单value属性,可以通过attr()操作. <! ...
- Python3从零开始爬取今日头条的新闻【四、模拟点击切换tab标签获取内容】
Python3从零开始爬取今日头条的新闻[一.开发环境搭建] Python3从零开始爬取今日头条的新闻[二.首页热点新闻抓取] Python3从零开始爬取今日头条的新闻[三.滚动到底自动加载] Pyt ...
- WordPress主题开发:通过page的ID或者别名获取内容
访问地址:xx/?page_id=12 如果是在当前页面,只需要通过循环就可以输出对应的信息 <?php if(have_posts()):while(have_posts()):the_pos ...
- jquery尺寸和jQuery设置和获取内容方法
一.jquery尺寸 jQuery 提供多个处理尺寸的重要方法: width() 设置或返回元素的宽度(不包括内边距.边框或外边距),括号中可填数值宽度参数,无单位 height() 设置或 ...
- iOS UIWebView 获取内容实际高度,关闭滚动效果
本文转载至 http://my.oschina.net/Khiyuan/blog/341535 iOS UIWebView 获取内容实际高度,关闭滚动效果 近期做东西,将 UIWebView 嵌套 ...
- jquery - 设置/获取内容和属性
一般我们会遇到给某个元素添加或更改原有的文字: 1. 设置/获取内容 - text().html() 以及 val() 设置内容常用的三个方法: text() - 设置或返回所选元素的文本内容 htm ...
- 使用UrlConnection请求一个url地址获取内容
访问网络需要加Internet权限:android.permission.INTERNET 使用UrlConnection请求一个url地址获取内容: //1.创建一个Url对 ...
随机推荐
- oc弹出框显示提示消息
- (void)ShowHUDTitle:(NSString *)title andDelay:(NSTimeInterval)delayTime { if (HUD) { [HUD removeFr ...
- August 15th 2016 Week 34th Monday
Why not discovering as there is glorious faraway scenery? 远方有诗篇,何不去发现? An advertisement of Land Rove ...
- JS 获取浏览器窗口大小
JS 获取浏览器窗口大小 <script> // 获取窗口宽度 if (windows.innerWidth) { winWidth = windows.innerWidth; } els ...
- 为 ASP.NET Web API 创建帮助页面(转载)
转载地址:http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages 当创建web API 时,经常要创 ...
- Pyqt 窗体间传值
窗体间传值网上有好多方法,比如新建文件,先将子类窗体的数据传到文件中,父窗体读取文件. Signal&Slot机制进行传值 等等 在这里,我们就举个采用apply方法:Signal& ...
- 【翻译五】java-中断机制
Interrupts An interrupt is an indication to a thread that it should stop what it is doing and do som ...
- Sencha Architect 安装与使用
http://www.sencha.com/products/touch/ Sencha SDK Tools Advanced JavaScript and CSS Project Build Too ...
- Linux LVM全面实践
1.磁盘分区 [root@ol6-121-rac1 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, no ...
- mac liteIDE调试配置
http://studygolang.com/articles/1636 brew install https://raw.github.com/Homebrew/homebrew-dupes/mas ...
- HP SAN Switch參考文檔地址
HP SAN Switch其實也是基於Linux內核 http://h20566.www2.hpe.com/portal/site/hpsc/template.PAGE/public/psi/manu ...