小胖说事35-----Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer posi
- 2011-06-11 15:19:17.167 ***[930:707] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [160 nan]'
- *** Call stack at first throw:
- (
- 0 CoreFoundation 0x3365d64f __exceptionPreprocess + 114
- 1 libobjc.A.dylib 0x33aa0c5d objc_exception_throw + 24
- 2 CoreFoundation 0x3365d491 +[NSException raise:format:arguments:] + 68
- 3 CoreFoundation 0x3365d4cb +[NSException raise:format:] + 34
- 4 QuartzCore 0x361db61d _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 140
- 5 QuartzCore 0x361db58b -[CALayer setPosition:] + 38
- 6 QuartzCore 0x361db4d7 -[CALayer setFrame:] + 390
- 7 UIKit 0x330eb455 -[UIView(Geometry) setFrame:] + 188
- 8 UIKit 0x3314854f -[UITableViewCell setFrame:] + 98
- 9 UIKit 0x33147b3b -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 850
- 10 UIKit 0x3314776b -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
- 11 UIKit 0x331400cd -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
- 12 UIKit 0x3313f27d -[UITableView layoutSubviews] + 140
- 13 UIKit 0x330eb5fb -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
- 14 CoreFoundation 0x335caf03 -[NSObject(NSObject) performSelector:withObject:] + 22
- 15 QuartzCore 0x361dcbb5 -[CALayer layoutSublayers] + 120
- 16 QuartzCore 0x361dc96d CALayerLayoutIfNeeded + 184
- 17 QuartzCore 0x361e21c5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
- 18 QuartzCore 0x361e1fd7 _ZN2CA11Transaction6commitEv + 190
- 19 QuartzCore 0x361db055 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 56
- 20 CoreFoundation 0x33634a35 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
- 21 CoreFoundation 0x33636465 __CFRunLoopDoObservers + 412
- 22 CoreFoundation 0x3363775b __CFRunLoopRun + 854
- 23 CoreFoundation 0x335c7ec3 CFRunLoopRunSpecific + 230
- 24 CoreFoundation 0x335c7dcb CFRunLoopRunInMode + 58
- 25 GraphicsServices 0x3413041f GSEventRunModal + 114
- 26 GraphicsServices 0x341304cb GSEventRun + 62
- 27 UIKit 0x33114d69 -[UIApplication _run] + 404
- 28 UIKit 0x33112807 UIApplicationMain + 670
- 29 PXiPhone 0x000028df main + 70
- 30 PXiPhone 0x00002894 start + 40
- )
- terminate called after throwing an instance of 'NSException
某天。加完一个功能,在iPhone4上报以上异常。然后crash掉,iPhone3上没事。
百思不得其解,于是google之。看了一篇stackoverflow.com 的文章,说是某些地方代码除以0了,多见于自己定义的UITableView自己定义UITableViewCell高度的地方。如:tableView:heightForHeaderInSection:
或tableView:heightForFooterInSection:。
这两个delegate方法都没有地方须要除的。在细致看一下文章,说多见于适用sizeWithFont方法计算UILabel宽高的地方。恍然大悟,小弟有一个地方使用了UILabel来显示文本,须要用到sizeWithFont方法计算宽高的,在NSString为nil的时候,sizeWithFont会除以0了。
PS:在使用sizeWithFont计算UItabelView中label中字的长度时。因为表视图的cell是复用的,所以在计算label中的NSString的长度时,NSString可能为nil,此时可能会除以0。便会报错。
小胖说事35-----Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer posi的更多相关文章
- Terminating app due to uncaught exception 'NSUnknownKeyException' this class is not key value coding-compliant for the key
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > se ...
- *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > ...
- 在使用可变数组过程中遇到*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'问题
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFD ...
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
报错: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlace ...
- iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to
刚接触iOS,依照教程操作执行出现错误 Terminating app due to uncaught exception 'NSInternalInconsistencyException', re ...
- *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbackParameters 0x1d4442e50> setNilValueForKey]: could not set nil as the value for the key rate.'
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbac ...
- Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fda42c66e30> is a part of cycle in its layer tree'
iOS App里面所有的View构成一个组件树,这个树里面如果有了闭环就会出现这个报错,最常见的你不小在某UIViewController里面写了这样的代码: someView.addSubView( ...
- iOS程序崩溃*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [37.5 nan]'
今天上班打开昨天的程序运行,昨天跑的很溜的程序今天竟然crash了,好郁闷啊!下面附上crash的栈打印信息: 经过一番调试终于找到了原因,程序crash是因为CALayer的位置中含有不存在的数,就 ...
- Terminating app due to uncaught exception 'NSUnknownKeyException', reason: xxxx
出现错误的情景: 使用Swift自定义Cell, 然后将这个Cell在OC中使用, 由于为了能够在OC中使用和使用起来命名比较规范 我在Swift自定义的Cell前加了 @objc(DSProduct ...
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSInvocation setArgument:atIndex:]: index (3) out of bounds [-1, 2]'
这是相机调用方法的时候参数错误
随机推荐
- 最近公共祖先-三(RMQ-ST)
描述 上上回说到,小Hi和小Ho使用了Tarjan算法来优化了他们的"最近公共祖先"网站,但是很快这样一个离线算法就出现了问题:如果只有一个人提出了询问,那么小Hi和小Ho很难决定 ...
- 什么是PHP中的heredoc和nowdoc
heredoc结构类似于双引号字符串,nowdoc结构是类似于单引号字符串的.nowdoc结构很像heredoc结构,但是 nowdoc不进行解析操作. 这种结构很适合用在不需要进行转义的PHP代码和 ...
- ECSHOP二次开发文档【文件结构说明和数据库表分析】
最近公司又把之前的ecshop进行二次开发,之前看过一些ecshop的东西,但是都过了很久差不多都忘完了,现在得把之前的重新捡回来,特此搜到这些文档,接下来的开发工作中会方便不少. Ecshop文件结 ...
- docker-ce快速部署
配置yum源wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repowget -O ...
- python 05 关于对python中引用的理解
数据的在内存中的地址就是数据的引用. 如果两个变量为同一个引用,那么这两个变量对应的数据一定相同: 如果两个变量对应的数据相同,引用不一定相同. 通过id(数据)可以查看数据对应的地址,修改变量的值, ...
- java环境配置——jdk8
在官网下载最新版本的jdk 测试版本:jdk-8u60-windows-x64.exe 测试环境:Windows Server 2012 R2 Standard X64 开始执行安装 安装过程中会选 ...
- 使用jemalloc优化nginx和mysql内存管理
预先安装autoconf 和 make yum -y install autoconf make jemalloc的安装jiemalloc 开源项目网站 http://www.canonware.co ...
- Vijos1655 - 萌萌的糖果博弈
Portal Description 两人轮流操作两堆初始数量分别为\(a,b(a,b\leq2^{127})\)的石子.每人每次进行如下操作: 取走一堆石子,并将另一堆分成两个非零堆. 如果另一堆只 ...
- 【2018 Multi-University Training Contest 3】
01:https://www.cnblogs.com/myx12345/p/9420198.html 02: 03: 04:https://www.cnblogs.com/myx12345/p/940 ...
- 【HDOJ6318】Swaps and Inversions(树状数组)
题意: 给定一串数组,其中含有一个逆序对则需要花费x,交换相邻两个数需要花费y,输出最小花费. n<=1e5,-1e9<=a[i]<=1e9 思路: #include<cstd ...