Putting current time into label

前端 未结 3 526
面向向阳花
面向向阳花 2021-01-03 07:44

Ii am trying to get date and time using date but when i run application it takes first time executed application time and date in short time is not changed.

         


        
3条回答
  •  暖寄归人
    2021-01-03 08:32

    [NSDate date] makes a date object of the time you call it. You must call it again to update the date. In other words, you must do StrDate = [NSDate date]; whenever you want to get the current date in your method.

提交回复
热议问题