iOS 数组越界 Crash处理经验
来源:互联网 发布:淘宝店铺按什么升级的 编辑:程序博客网 时间:2024/05/12 07:21
- @interface NSArray (SHYUtil)
- /*!
- @method objectAtIndexCheck:
- @abstract 检查是否越界和NSNull如果是返回nil
- @result 返回对象
- */
- - (id)objectAtIndexCheck:(NSUInteger)index;
- @end
- #import "NSArray+SHYUtil.h"
- @implementation NSArray (SHYUtil)
- - (id)objectAtIndexCheck:(NSUInteger)index
- {
- if (index >= [self count]) {
- return nil;
- }
- id value = [self objectAtIndex:index];
- if (value == [NSNull null]) {
- return nil;
- }
- return value;
- }
- @end
转载自: http://blog.csdn.net/jxncwzb/article/details/44829925
0 0
- iOS 数组越界 Crash处理经验
- iOS 数组越界 Crash处理经验
- iOS 数组越界 Crash处理经验
- iOS 数组越界 Crash处理经验
- iOS 数组越界,防Crash处理,性能优化 —— HERO博客
- 数组越界Crash
- iOS 数组越界处理方法总结
- [iOS]防止数组越界及添加空值的crash的扩展
- IOS数组越界
- 运行时处理数组越界
- iOS中防止数组越界
- IOS crash处理
- IOS Parse 处理crash
- iOS Crash 处理办法
- IOS crash处理
- iOS 防止数组越界 对象类型不一致的安全处理 使用category对nsmutablearray处理
- 数组越界写入破坏程序堆栈导致的crash
- C# 数组越界的一场处理
- Android开发使用的常见第三方框架汇总
- 用Storage Foundation管好存储系统-文件系统
- salt-minion dead but pid file exists
- Java创建和解析Json数据方法(三)——json-lib包的使用
- C语言 枚举 enum
- iOS 数组越界 Crash处理经验
- C++指针的问题
- C语言学习之类型转换第一讲
- eclipse版本代号
- Storage foundation卷管理及主要进程
- Android 通知栏Notification的整合 全面学习
- 初学循环队列
- HDOJ 1021 Fibonacci Again
- Recycle 点击事件区别 getPosition() ,getLayoutPosition(),getAdapterPosition()