简体   繁体   中英

cellForRowAtIndexPath is called but without stacktrace

Using Swift 3, the UITableView's func tableView(_ tableView: UITableView, cellForRowAt indexPath: @autoclosure @escaping IndexPath) -> UITableViewCell is being called. I want to track who's calling this function. As far as I know, this will only be called if there's a need for a cell to display. However, in stacktrace override internal func tableView(_ tableView: UITableView, numberOfRowsInSection section: @autoclosure @escaping Int) -> Int is not called and there is no stacktrace. Could someone advice to where to start digging up? Thanks!

See attached screenshot 没有堆栈跟踪

By default, you only see the stack trace that contains debug symbols. So you won't see many framework internals here.

To see everything , there is a small button at the bottom of the stack trace window, third position from the right, that will enable also methods without debug symbols:

启用/禁用完整堆栈跟踪

(In fact, it depends on your Xcode version; in older versions there is some sort of slider which will display more or less details in the stack trace).

As @AndreasOetjen mentioned, this is a normal behavior because the method get's called from a UIKit Framework class. The call-stack in this Framework is hidden by default and can be opt-io by the mentioned buttons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM