- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有 SIGSEGV 的崩溃报告。我认为这真的不明显,因为有:
只发生过一次,所以没有重现的步骤
崩溃日志如下:
0 libobjc.A.dylib 0x0000000181d6dbd0 objc_msgSend + 16
1 Foundation 0x0000000182fc28e4 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 320
2 QuartzCore 0x0000000184ddf374 CA::Layer::set_delegate(objc_object*) + 68
3 UIKit 0x00000001873e2538 -[UIView _createLayerWithFrame:] + 576
4 UIKit 0x00000001873e1ff8 UIViewCommonInitWithFrame + 684
5 UIKit 0x00000001873e1ce8 -[UIView initWithFrame:] + 136
6 UIKit 0x00000001874c0ee8 -[UITableViewCell initWithStyle:reuseIdentifier:] + 108
7 MyApp 0x000000010017d208 MyApp.MessageCell.init (MyApp.MessageCell.Type)(style : __C.UITableViewCellStyle, reuseIdentifier : Swift.String?) -> MyApp.MessageCell (MessageCell.swift:23)
8 MyApp 0x000000010017d340 @objc MyApp.MessageCell.init (MyApp.MessageCell.Type)(style : __C.UITableViewCellStyle, reuseIdentifier : Swift.String?) -> MyApp.MessageCell (MessageCell.swift:0)
9 UIKit 0x000000018752bbe0 -[UITableView _dequeueReusableViewOfType:withIdentifier:] + 524
10 UIKit 0x0000000187567bd4 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 84
11 MyApp 0x000000010016d60c MyApp.ChatDataSource.dequeueMessageCell (MyApp.ChatDataSource)(MyApp.Message, tableView : __ObjC.UITableView, indexPath : __ObjC.NSIndexPath) -> __ObjC.UITableViewCell (ChatDataSource.swift:76)
12 MyApp 0x000000010016cf48 MyApp.ChatDataSource.cellAtIndexPath (MyApp.ChatDataSource)(__ObjC.NSIndexPath!, inTableView : __ObjC.UITableView!) -> __ObjC.UITableViewCell! (ChatDataSource.swift:55)
13 MyApp 0x000000010016d324 @objc MyApp.ChatDataSource.cellAtIndexPath (MyApp.ChatDataSource)(__ObjC.NSIndexPath!, inTableView : __ObjC.UITableView!) -> __ObjC.UITableViewCell! (ChatDataSource.swift:0)
14 MyApp 0x000000010005cb34 -[SFPaginationDataSource tableView:cellForRowAtIndexPath:] (SFPaginationDataSource.m:202)
15 UIKit 0x000000018773131c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 688
16 UIKit 0x0000000187731484 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 76
17 UIKit 0x00000001877207e8 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2356
18 UIKit 0x0000000187735fb0 -[UITableView _performWithCachedTraitCollection:] + 100
19 UIKit 0x00000001874cb08c -[UITableView layoutSubviews] + 172
20 UIKit 0x00000001873db778 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 652
21 QuartzCore 0x0000000184deab2c -[CALayer layoutSublayers] + 144
22 QuartzCore 0x0000000184de5738 CA::Layer::layout_if_needed(CA::Transaction*) + 288
23 UIKit 0x00000001873f2454 -[UIView(Hierarchy) layoutBelowIfNeeded] + 920
24 TextViewController 0x0000000100ec03f4 0x100ea8000 + 99316
25 MyApp 0x00000001001f5680 MyApp.ChatViewControler.viewWillAppear (MyApp.ChatViewControler)(Swift.Bool) -> () (ChatViewControler.swift:52)
26 MyApp 0x00000001001f59a4 @objc MyApp.ChatViewControler.viewWillAppear (MyApp.ChatViewControler)(Swift.Bool) -> () (ChatViewControler.swift:0)
27 UIKit 0x00000001873f874c -[UIViewController _setViewAppearState:isAnimating:] + 624
28 UIKit 0x00000001873f84c0 -[UIViewController __viewWillAppear:] + 152
29 UIKit 0x0000000187591ce4 -[UINavigationController _startCustomTransition:] + 1048
30 UIKit 0x000000018749e9b8 -[UINavigationController _startDeferredTransitionIfNeeded:] + 684
31 UIKit 0x000000018749e694 -[UINavigationController __viewWillLayoutSubviews] + 56
32 UIKit 0x000000018749e5fc -[UILayoutContainerView layoutSubviews] + 204
33 UIKit 0x00000001873db778 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 652
34 QuartzCore 0x0000000184deab2c -[CALayer layoutSublayers] + 144
35 QuartzCore 0x0000000184de5738 CA::Layer::layout_if_needed(CA::Transaction*) + 288
36 QuartzCore 0x0000000184de55f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
37 QuartzCore 0x0000000184de4c94 CA::Context::commit_transaction(CA::Transaction*) + 248
38 QuartzCore 0x0000000184de49dc CA::Transaction::commit() + 508
39 UIKit 0x00000001873d1c78 _afterCACommitHandler + 176
40 CoreFoundation 0x00000001826a4588 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
41 CoreFoundation 0x00000001826a232c __CFRunLoopDoObservers + 368
42 CoreFoundation 0x00000001826a275c __CFRunLoopRun + 924
43 CoreFoundation 0x00000001825d1680 CFRunLoopRunSpecific + 380
44 GraphicsServices 0x0000000183ae0088 GSEventRunModal + 176
45 UIKit 0x0000000187448d90 UIApplicationMain + 200
46 MyApp 0x0000000100199718 main (AppDelegate.swift:17)
47 ??? 0x00000001821728b8 0x0 + 0
MessageCell.swift
import UIKit
class MessageCell: UITableViewCell, ConfigurableCell {
var messageView = MessageView()
var alignment: MessageLayout.MessageAligmment {
get { return messageView.layout.mode }
set {
messageView.layout.mode = newValue
}
}
override required init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
defaultInit()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
defaultInit()
}
func defaultInit() {
selectionStyle = .None
contentView.addSubview(messageView)
messageView.autoPinEdgesToSuperviewEdges()
}
func configure(item: Message) {
messageView.configure(item)
}
}
最佳答案
“它不是无效的 KVO 观察者的结论是不正确的,因为它发生在对象的初始化过程中。由于历史原因,KVO 使用侧表将对象地址与观察者相关联。这意味着如果原始观察者被释放,那么下一个占用相同地址的对象实际上是新的被观察者。KVO 将表现得好像正在观察新对象,并尝试向可能也被释放的观察者发出更改通知。来自 discussion
关于ios - 崩溃 [UITableViewCell initWithStyle :reuseIdentifier:],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34397995/
想知道以下代码中 if (self = [super ... 的意义是什么?它试图防止什么情况发生? - (id)initWithFrame:(CGRect)frame reuseIdentifier
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 上述构造函数中的
我正在尝试获取单元格的重用标识符,以便我可以像这样设置其高度: 但是出现错误: 我做错了什么? 最佳答案 tableView heightForRowAtIndexPath 在cellForRowAt
我创建了两个不同的单元格以在其中显示不同的数据。我为它们分配了 reuseIdentifier("TableCell" 和 "FixtureCell")。他们有两个不同的类,名为 FixtureTab
我已经为 UITableView 创建了一个扩展,并希望在运行时获得正确的 reuseIdentifier,但我不能: extension UITableView { func dequeueReus
我想使用 UITableviewCell 重用,我有一个自定义的 UITableViewCell 和使用 ARC,我的 UITableViewCell 是不同的。我的代码是: - (UITableV
你能帮我解决这个问题吗,因为方法 initWithFrame:reuseIdentifier 已被弃用: static NSString *CellIdentifier = @”Cell”; Cust
我试图重新创建一个 Xcode 项目,但我遇到了一个错误“'initWithFrame:reuseIdentifier' is deprecated”。这是代码: - (id)initWithFram
在我的项目中,我收到了弃用警告,initWithFrame : reuseIdentifier : is deprecated 我不知道这是什么意思,谁能告诉我如何解决这个警告谢谢 这是短代码 - (
我正在创建自己的自定义 UITableViewCell 以用作原型(prototype)单元格的后端。在我的类中,我重写了 initwithstyle:reuseIdentifier: 方法来执行一些
我现在考虑这个问题很长时间了。 我尝试在我的表格中使用不同类型的单元格,每个单元格都有自己的单元格 Controller ,并有一个重用标识符和来自 NIB 的负载。 问题归结为:您可以通过 [UIT
我有一个自定义的 UICollectionViewCell,我通过像这样注册它来将它从我的 View Controller 中取出 [self.calendarView registerNib:[UI
我有一个最多包含 50 个单元格的 TableView,其中包含 5 个包含公共(public)信息(标题、描述、价格...)的 subview 和 5 个可选 subview (报价、报价过期...
如果我尝试返回默认的 UICollectionViewCell 应用程序崩溃,因为它缺少 reuseIdentifier: Terminating app due to uncaught except
我有 SIGSEGV 的崩溃报告。我认为这真的不明显,因为有: 无后台 UI 操作。 没有外部 CALayer 操作。 UITableViewCell 以编程方式初始化,不使用 xib 或 Story
据我了解,如果不期望该单元格被重用,则创建一个 reuseIdentifier 为 nil 的 UITableViewCell 是有效的,例如当该类型的单元格只有一两行时。 前几天有人提出这是不正确的
我在 Swift 中使用一个 TableViewController 和一个原型(prototype)单元格。该单元有一个在 Storyboard 中指定的重用标识符,但它永远不会正确出列。我总是收到
表格 View 单元格的重用标识符的范围是什么——它们是在一个表格 View 实例中共享,还是在所有使用相同重用标识符的表格 View 中共享? 例如,我有一个 FooTableViewControl
我已阅读 Loren's article关于为 UITableViewCell 绘制您自己的内容。但是,他使用的是一种已弃用的方法:initWithFrame:reuseIdentifier: is
据我了解,似乎有三种布局自定义表格 View 单元格的方法: 在界面生成器中。 在 layoutSubviews . 在 initWithStyle:reuseIdentifier: . 第二种方法和
我是一名优秀的程序员,十分优秀!