Xcode9 和 iOS11 遇到的问题

Xcode9 iOS11 遇到的问题

1、xcode9 UI API called from background thread: -[UIApplication currentUserNotificationSettings] must be used from main thread only

解决:对应的库(JPush)在xcode9上运行需要更新到最新版本(其他类似问题也一样的解决方法)


2、MJRefresh上拉刷新,明明已经调用结束刷新,但是并没有作用,还在一直加载请求数据,如下图所示:

Xcode9 和 iOS11 遇到的问题


解决方法: 

self.tableView.estimatedRowHeight = 0;

self.tableView.estimatedSectionHeaderHeight = 0;

self.tableView.estimatedSectionFooterHeight = 0;


3、UITableViewStyleGrouped样式的UITableViewsectionHeadersectionFooter有一个默认的高度,通常不需要显示header或者footer的时候,会这么写

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {

    return CGFLOAT_MIN;

}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {

    return CGFLOAT_MIN;

}

但是在iOS11里面你会发现段头段尾又回来辣!改了各种新增的属性比如safeArea之类的一点用都没有,最后发现必须要把estimatedSectionHeaderHeight0才变回去(类问题2)


4、UIToolbar上添加子视图[self.toolbar addSubview:sendButton];

控件无法响应事件

更改:[self.toolbar setItems: sendButton];




5、iOS11 UITextFiled 有内存泄漏(未解决,待续)