如何替换数组swift数组中的对象?

时间:2017-11-30 10:54:14

标签: ios arrays swift

我有数组数组我想替换它的对象。我有一个键值,所以我可以比较与所有对象,如果匹配,则替换该特定数组中的整个对象。我的代码是用swift编写的。

我有钥匙"名字"如果与对象匹配则替换整个对象。

例如," name":" javed" 与所有对象(myproject.ObjChat.name)进行比较,如果找到匹配项,则替换为新的ObjChat。

(

    (

    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat"
),
    (
    "myproject.ObjChat"
),
    (
    "myproject.ObjChat"
),
    (
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat",
    "myproject.ObjChat"
)
)

0 个答案:

没有答案