答案 0 :(得分:1)
根据我的评论,您的代码必须是:
private func updateTimer() {
let currentDate = NSDate()
let timeInterval = currentDate.timeIntervalSince(self.startDate)
let timerDate = NSDate(timerIntervalSince1970: timeInterval)
}
或
private func updateTimer() {
//we don't have to create the variable "currentDate".
let timeInterval = NSDate().timeIntervalSince(self.startDate)
let timerDate = NSDate(timerIntervalSince1970: timeInterval)
}
答案 1 :(得分:1)
对于Swift 3,请使用日期:
@ThriftHandler("/api")
public class TGreetingServiceHandler implements TGreetingService.Iface {
@Override
public String greet(TName name) throws TException {
// your logic
}
}