Skip to content

If I'm changing the time on an existing alarm, and keeping the same id, do I need to stop and set it, or just set it? #201

Closed Answered by ApplySci
ApplySci asked this question in Q&A
Discussion options

You must be logged in to vote

I've found a workaround now, which is to call stopAllAlarms before setting any.

I've got quite a convoluted setup for Mac, which might create a situation that is (1) not a real world case and (2) hard to reproduce: I've got a windows pc running Mac Monterey ios on VMWare, and then I'm simulating an iPhone 14 on that.

I've got a few alarms that get set, and sometimes one or two of the times get updated. To keep it simple, I re-set all the alarms when I get a notification that a time has been updated. If a time has changed, then Alarm.set behaves fine. But if the alarm hasn't changed, then it crashes.

But now I'm awaiting stopAllAlarms before setting any, there's no crash.

I may have an act…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ApplySci
Comment options

Answer selected by gdelataillade
@ApplySci
Comment options

@gdelataillade
Comment options

@ApplySci
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants