是什么在斯威夫特VS字典NSDictionary的区别? [英] What is difference between NSDictionary vs Dictionary in Swift?

查看:117
本文介绍了是什么在斯威夫特VS字典NSDictionary的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习斯威夫特,我可以看到词典在里面。结果
但也有很多正在使用的NSDictionary 与斯威夫特的例子。结果
有什么两个?结果之间的差异
我想使用索引的数组中的斯威夫特像PHP中的数组。结果
哪一个是更好地使用?

I'm learning Swift, and I can see Dictionary in it.
But there are lots of examples that are using NSDictionary with Swift.
What's the difference between the two?
I want to use an array with index in Swift like an array in PHP.
Which one is better to use?

推荐答案

词典是土生土长的斯威夫特结构。的NSDictionary是一类可可。它们都将通过桥彼此(通常的范围内),作为文档解释得很清楚,并充分。

Dictionary is a native Swift struct. NSDictionary is a Cocoa class. They are bridged to one another (within the usual limits), as the docs explain very clearly and fully.

它完全平行阵列和NSArray的。

It's exactly parallel to Array and NSArray.

这篇关于是什么在斯威夫特VS字典NSDictionary的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆