PNDate在swift中返回nil

时间:2015-02-17 14:27:09

标签: xcode swift pubnub

我用左 PubNub.requestFullHistoryForChannel(channel , includingTimeToken: true , withCompletionBlock: { messages , channel , startDate , endDate , error in let dic = messages[0].message as Dictionary<String , String> let date = messages[0].date as PNDate! })
获取历史消息 当我使用println()来显示消息时**日期:PNDate **不是nil

 "PNMessage (0x7fcb69d252c0): <message: {\n    text = yup;\n    type = fromUser;\n}, date: PNDate (0x7fcb69d25300) <date: 2015-02-17 12:21:31 +0000; time token: 14241756912535903>, channel: Hazem>"

1 个答案:

答案 0 :(得分:0)

我可以从

获取发送消息的时间
let date = messages[i].receiveDate  as PNDate