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

MVVM-C example fails assertion, crashes on launch #23

Open
jefflovejapan opened this issue May 23, 2019 · 2 comments
Open

MVVM-C example fails assertion, crashes on launch #23

jefflovejapan opened this issue May 23, 2019 · 2 comments

Comments

@jefflovejapan
Copy link

jefflovejapan commented May 23, 2019

The problem seems to be on line 20 of FolderViewController:

viewModel.folderContents.bind(to: tableView.rx.items(dataSource: dataSource)).disposed(by: disposeBag)

I'm getting the following:

2019-05-23 12:20:09.318611-0300 Recordings[15921:6162304] Warning: Unable to create restoration in progress marker file
Assertion failed: This is a feature to warn you that there is already a delegate (or data source) set somewhere previously. The action you are trying to perform will clear that delegate (data source) and that means that some of your features that depend on that delegate (data source) being set will likely stop working.
If you are ok with this, try to set delegate (data source) to `nil` in front of this operation.
 This is the source object value: <UITableView: 0x7fa7e805c200; frame = (0 0; 375 812); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x60800005bdb0>; layer = <CALayer: 0x60000023a040>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}>
 This is the original delegate (data source) value: <Recordings.FolderViewController: 0x7fa7e7d1a890>
Hint: Maybe delegate was already set in xib or storyboard and now it's being overwritten in code.
: file /Users/jeff/Developer/app-architecture/Recordings-MVVM-C/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift, line 222
2019-05-23 12:20:15.881476-0300 Recordings[15921:6162304] Assertion failed: This is a feature to warn you that there is already a delegate (or data source) set somewhere previously. The action you are trying to perform will clear that delegate (data source) and that means that some of your features that depend on that delegate (data source) being set will likely stop working.

This seems to happen in both Xcode 9.4.1 and 10.2 using RxSwift 4.0.0 and RxDataSources 3.0.2. Setting the tableView's delegate and dataSource to nil after super.viewDidLoad() fixes the issue for me.

@evanbrass
Copy link

same for me - I tried installing RxSwift using cocoapods, but so far haven't had any success

@leopic
Copy link

leopic commented Oct 11, 2020

@jefflovejapan thanks for the heads up, this was the only way I could get the app to run

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

No branches or pull requests

3 participants