-
-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
When you replace the specific content "X-X\n" with "XX\n" using "self.contentView.textView.text", you can always reproduce the error:
Runestone/RedBlackTree.swift:39: Fatal error: 2 is out of bounds. Valid range is 0 - 0. This issue is under investigation. Please open an issue at https://github.com/simonbs/Runestone/issues and include this stack trace and a sample text file if possible. This fatal error is only thrown in debug builds.
Reproducible with
- iPhone 15 Pro with iOS 26.1
- Xcode 26.1 (17B55)
Please see attached video
What are the steps to reproduce?
-
Add code to execute
self.contentView.textView.text = "XX\n"For example:
extension MainViewController: MenuSelectionHandler { // swiftlint:disable:next cyclomatic_complexity func handleSelection(of menuItem: MenuItem) { switch menuItem {to
extension MainViewController: MenuSelectionHandler { // swiftlint:disable:next cyclomatic_complexity func handleSelection(of menuItem: MenuItem) { debugPrint("**** WILL CHANGE!") self.contentView.textView.text = "XX\n" debugPrint("**** DID CHANGE!") switch menuItem { -
Compile and run the Example app
-
Type in the UI "X-X\n". Note that you need to type or paste this text.
-
Tap on More > Find to trigger the code
self.contentView.textView.text = "XX\n"
Result:
"**** WILL CHANGE!"
Runestone/RedBlackTree.swift:39: Fatal error: 2 is out of bounds. Valid range is 0 - 0. This issue is under investigation. Please open an issue at https://github.com/simonbs/Runestone/issues and include this stack trace and a sample text file if possible. This fatal error is only thrown in debug builds.
video.mov
What is the expected behavior?
Such an error should not occur.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working