After pulling the source code locally, some Delegates will report errors
Describe the bug After pulling the source code locally, some Delegates will report errors
SDK Version 2.0.10 ~ 2.0.11
iOS/macOS Version iOS17.2
Steps to Reproduce
No need for Swift Package Manager, simply pull the source code locally
- Connect Room
- Open Camera
- Crash
If I remove @objc, it will work normally. (or do I just use newValue?.delegates.add(delegate: self) It also works (but the entire livekit sdk has too many delegates, it is too troublesome to change them all)
I feel like it's a problem with the Swift version being too high, but I don't know how to solve it.
Screenshots
- Can you tell me your Xcode version?
- Are you using the SDK with Objective-C or Swift?
- Is it reproducible for you?
- Xcode 15.4 and Swift 5.10
- Swift
- Yes
My current solution is to no longer use add and remove with @objc, but instead use xxx.delegates.add() directly.
eg:
Hmm.. It's odd that you need to do that, is it only with TrackDelegate ?
Not only 'TrackDelegate', but all delegate add remove with @objc, as shown in the screenshot below, are like this.
Hmm looks like some Xcode bug, I'm not sure how to reproduce this at the moment.
Okay, then I will continue to follow up