X Tutup
The Wayback Machine - https://web.archive.org/web/20201017205539/https://github.com/netease-im/NIM_iOS_UIKit/issues/264
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

群内的提示消息触发xcode警告 #264

Open
zhangliyong1024 opened this issue Apr 9, 2020 · 3 comments
Open

群内的提示消息触发xcode警告 #264

zhangliyong1024 opened this issue Apr 9, 2020 · 3 comments

Comments

@zhangliyong1024
Copy link

@zhangliyong1024 zhangliyong1024 commented Apr 9, 2020

问题检查清单

感谢您向我们提出问题,在提交问题之前,请确认以下事宜:

问题描述

问题现象

[描述具体问题表现]

是否重现

[重现此问题的步骤]

其它备注

[在这里添加任何其他相关细节]

@zhangliyong1024
Copy link
Author

@zhangliyong1024 zhangliyong1024 commented Apr 9, 2020

修改群信息时,SessionViewController展示一条群提示消息:你更新了群名称。

xcode提示警告信息:

@zhangliyong1024
Copy link
Author

@zhangliyong1024 zhangliyong1024 commented Apr 9, 2020

2020-04-09 14:42:04.537056+0800 GrootDev[81929:4510369] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <UITableView: 0x7fa51d83d400; frame = (0 0; 375 616); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600003f36190>; layer = <CALayer: 0x6000031f0100>; contentOffset: {0, 273.5}; contentSize: {375, 889.33332824707031}; adjustedContentInset: {64, 0, 0, 0}; dataSource: <NIMSessionTableAdapter: 0x6000031f6740>>

@zhangliyong1024
Copy link
Author

@zhangliyong1024 zhangliyong1024 commented Apr 9, 2020

通过UITableViewAlertForLayoutOutsideViewHierarchy断点定位出现问题的代码在NIMSessionLayoutImpl.m第241行:
{
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:addIndexPathes
withRowAnimation:UITableViewRowAnimationNone];
[self.tableView endUpdates];
[self.tableView scrollToRowAtIndexPath:addIndexPathes.lastObject
atScrollPosition:UITableViewScrollPositionTop
animated:NO];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup