gpt4 book ai didi

ios - 升级到 Xcode8 后 React Native RCCTCustomScrollView 损坏

转载 作者:可可西里 更新时间:2023-11-01 06:02:20 26 4
gpt4 key购买 nike

显然,this is a well known issue用于在升级到 Xcode 8 时做出 native react 。我已经关注了 this修复我遇到的错误的指南,但当我的应用程序尝试加载 <ScrollView/> 时,我仍然收到以下错误组件。

[RCTCustomScrollView refreshControl]: unrecognized selector sent to instance 0x16099e00

我的RCTScrollView.m中的代码每个人似乎都认为导致问题的原因如下所示:

- (void)setRefreshControl:(RCTRefreshControl *)refreshControl
{
if (refreshControl) {
[refreshControl removeFromSuperview];
}
refreshControl = refreshControl;
[self addSubview:refreshControl];
}

- (void)removeReactSubview:(UIView *)subview
{
if ([subview isKindOfClass:[RCTRefreshControl class]]) {
_scrollView.refreshControl = nil;
} else {
RCTAssert(_contentView == subview, @"Attempted to remove non-existent subview");
_contentView = nil;
[subview removeFromSuperview];
}
}

当我在运行 iOS 10.1.1 的设备上运行它时似乎一切正常,但是当我在运行 9.3 的设备上尝试时,它在尝试加载 <ScrollView/> 时崩溃了。 .

重要提示- 我正在运行 react native 0.28 并且处于我现在无法升级的紧张情况,因此我必须手动进行修复。

最佳答案

我知道这是一篇较旧的帖子,但对于 Xcode 8、iOS 9.3 (iPad 2/iPad Mini)、React Native 0.24.1,我在 RCT ScrollView.m 中进行了此更改作为修复。

@implementation RCTCustomScrollView
{
__weak UIView *_dockedHeaderView;

// Added the following line
RCTRefreshControl *_refreshControl;
}
// Also added this
@synthesize refreshControl = _refreshControl;

关于ios - 升级到 Xcode8 后 React Native RCCTCustomScrollView 损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40892638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com