CustomCell崩溃的UITableView [英] CustomCell crash in UItableView
问题描述
我一直在使用 customCell.xib
与自己的 customCellClass
中的的UITableView
,这是不使用内置的autoLayout
功能(因为我需要做出的平台上它的工作 iOS6的前code>)。
在其数据源
方法的UITableView
取这个定制的厦门国际银行的细胞。
我现在面临的困境是,在的UITableView
崩溃的我跑,但执行时突然次50%,并显示tabeview时代的完美休息..
我米目前使用X code ++ 4.5。
下面是崩溃日志我收到..
自动布局执行-layoutSubviews后仍然需要。
的UITableViewCell的实施-layoutSubviews的需要调用
超级
块引用>解决方案这已经覆盖在一些细节在这里,它不是简单,只要简单地调用[超级layoutSubviews];
<一个href=\"http://stackoverflow.com/questions/12610783/auto-layout-still-required-after-executing-layoutsubviews-with-uitableviewcel\">"Auto布局执行-layoutSubviews&QUOT后仍然需要;与子类的UITableViewCell
尝试禁用translatesAutoresizingMaskIntoConstraints每个的观点。自动布局以某种方式被触发,并导致在UITableView的这个bug流行起来。
I have been using a
customCell.xib
with its owncustomCellClass
within aUITableView
,which is built without usingautoLayout
feature(since I need to make it work even on platforms prior toiOS6
). TheUITableView
fetches this custom made xib cell in itsdataSource
method. The dilemma I'm facing is that theUITableView
crashes abruptly 50 % of times I run it but executes and shows the tabeview perfectly rest of the times..I m currently using XCode 4.5.
Here's the crash Log i receive ..
'Auto Layout still required after executing -layoutSubviews. UITableViewCell's implementation of -layoutSubviews needs to call super.'
解决方案This has been covered in some detail here, and it is not as simple as simply calling [super layoutSubviews];
"Auto Layout still required after executing -layoutSubviews" with UITableViewCell subclass
Try disabling 'translatesAutoresizingMaskIntoConstraints' on each of your views. Auto Layout is somehow being triggered, and that causes this bug on UITableView to pop up.
这篇关于CustomCell崩溃的UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!