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

[SR-13576] UIDatePicker crashes app when enabling/disabling 24-hour time multiple times #56014

Closed
swift-ci opened this issue Sep 21, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.) UIKit

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 21, 2020

Previous ID SR-13576
Radar rdar://problem/69308996
Original Reporter tassiomm (JIRA User)
Type Bug
Environment

XCode Version: 11.3.1

Device: iPhone 6s Plus

Device iOS Version: 13.6

Xcode Project:

Swift 5

Target: iOS 13.2

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: a3245dac2c3ee77de8e819d6cd8bd781

Issue Description:

UIDatePicker will crash if user switches 24-hour time multiple times and opening the app between switches.

Reproducible test case:

Create a new Single View App Project in Swift. Go to ViewController that XCode already created and paste the code:

 import UIKit
 class ViewController: UIViewController {
     private var someDatePicker = UIDatePicker()
 }

Steps:

  • Before running the app make sure Settings > General > Date & Time > 24-Hour Time is enabled.
  • Run the app
  • Close the app (do NOT kill it)
  • Switch 24-Hour Time toggle
  • Open the app again
  • Repeat the last 3 steps 3 Times
  • The app will crash and the console output should print the following exception:
    -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]
@typesanitizer
Copy link

@swift-ci create

@swift-ci
Copy link
Collaborator Author

Comment by Tassio Moreira Marques (JIRA)

Note: For reference, setting the calendar prevents the bug from happening:

someDatePicker.calendar = Calendar(identifier: .gregorian)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.) UIKit and removed standard library Area: Standard library umbrella labels Jul 27, 2023
@AnthonyLatsis
Copy link
Collaborator

This sounds very much like an issue with UIKit (not the compiler or Standard Library). @tassiomm Assuming you are the author, please use the feedback assistant for these sorts of SDK bugs.

@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. off topic Resolution: Is beyond the scope of the Swift project (Xcode, proprietary Apple frameworks, etc.) UIKit
Projects
None yet
Development

No branches or pull requests

3 participants