Closed sgermain06 closed 6 years ago
I found the problem. The problem is that the touchesMoved:
method was being called every time the view was touched, regardless of where, calling touchClock:
. That method is selecting a time based on an angle calculation from the center of the view. Touching AM/PM was triggering that method, calculating that AM meant 7 o'clock was selected, same as PM, selecting 5 o'clock.
I added a check to the touchesMoved:
method to see if the touch is within the bounds for the AM and PM buttons and if not, call touchClock:
. Now the selected time remains.
I found the problem. The problem is that the
touchesMoved:
method was being called every time the view was touched, regardless of where, callingtouchClock:
. That method is selecting a time based on an angle calculation from the center of the view. Touching AM/PM was triggering that method, calculating that AM meant 7 o'clock was selected, same as PM, selecting 5 o'clock.I added a check to the
touchesMoved:
method to see if the touch is within the bounds for the AM and PM buttons and if not, calltouchClock:
. Now the selected time remains.
please can you provide me clear solution
For some reason, if I present a time selector, I can select an hour and then change from AM to PM. After changing AM/PM, the value of the hour I selected changes. Is it possible to retain the selected hour value when changing AM/PM?