override func viewDidLoad() { super.viewDidLoad() for column in tableView.tableColumns { let headerCell = MyHeaderCell.init(textCell: column.title) column.headerCell = headerCell } }
再現リポジトリです。実行するだけでクラッシュします。 クラッシュしない場合はテーブルのカラムを思いっきり左右にドラッグすると死にます。 https://github.com/omochi/nstableheadercell-bug (edited)2017-11-21 11:23:53.295486+0900 nstableheadercellbug[23493:18211887] Unknown Window class (null) in Interface Builder file, creating generic Window instead [Cat(0x00006100000490c0)::init] [MyHeaderCell(0x00006100000a0120)::init(textCell:)] [Cat(0x00006100000492d0)::init] [MyHeaderCell(0x00006100000a13e0)::init(textCell:)] [Cat(0x0000610000049360)::init] [MyHeaderCell(0x00006100000a14a0)::init(textCell:)] [MyHeaderCell(0x00006180000a6120)::deinit] [Cat(0x0000610000049360)::deinit] [MyHeaderCell(0x00006080000a55e0)::deinit]
default column: 0x00006080000a0ea0 [MyHeaderCell(0x00006180000a23a0)::init(textCell:)] default column: 0x00006080000a1020 [MyHeaderCell(0x00006180000a21c0)::init(textCell:)] default column: 0x00006080000a11a0 [MyHeaderCell(0x00006180000a2820)::init(textCell:)] [MyHeaderCell(0x00006080000a20a0)::deinit] [MyHeaderCell(0x00006080000a2460)::deinit] [MyHeaderCell(0x00006100000a2b20)::deinit] [MyHeaderCell(0x00006100000a3360)::deinit] [MyHeaderCell(0x00006100000a3240)::deinit] [MyHeaderCell(0x00006080000a4140)::deinit]