Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS XMPPFramework-如何获取MUC消息的昵称?_Ios_Xmppframework_Multiuserchat - Fatal编程技术网

iOS XMPPFramework-如何获取MUC消息的昵称?

iOS XMPPFramework-如何获取MUC消息的昵称?,ios,xmppframework,multiuserchat,Ios,Xmppframework,Multiuserchat,当我使用XMPPFramwork加入MUC房间时,我会通过委派方法收到新消息: func xmppRoom(sender: XMPPRoom!, didReceiveMessage message: XMPPMessage!, fromOccupant occupantJID: XMPPJID!) { } 如何获取发送邮件的用户的昵称 我尝试了message.from().user,但没有打印昵称 我现在使用message.fromStr())!。lastPathComponent但这感觉非

当我使用XMPPFramwork加入MUC房间时,我会通过委派方法收到新消息:

func xmppRoom(sender: XMPPRoom!, didReceiveMessage message: XMPPMessage!, fromOccupant occupantJID: XMPPJID!) {

}
如何获取发送邮件的用户的昵称

我尝试了
message.from().user
,但没有打印昵称

我现在使用
message.fromStr())!。lastPathComponent但这感觉非常错误


有更好的方法吗?

我知道这已经太晚了,但是,这个答案可能会帮助其他人,所以我发布了答案

// this statement gives sender's nick name
message.attributeForName("from").stringValue
希望这有帮助。

尝试以下内容:

Message.from().resource