1
如果我有字典在我的NSUserDefaults的數組:對象爲Array
["name":"John", "birthplace":"New York"]
["name":"Eric", "birthplace":"London"]
["name":"Sven", "birthplace":"Stockholm"]
["name":"Pierre", "birthplace":"Paris"]
什麼是讓所有的名字變成這樣
John, Eric, Sven , Pierre
更新問題。我如何將這個數組從NSUserDefaults中取出? – cannyboy
是的,他們被保存着像defaults.setObject([[「名稱」:「約翰」,「出生地」:「紐約」],[「名稱」:「埃裏克」,「出生地」:「倫敦」] ],forKey:「people」) – cannyboy
如果我做了'var peopleArray = defaults.arrayForKey(「people」)''那麼flatMap代碼就會產生'Can not subscript'類型爲'[AnyObject]'的類型爲'String' '(Swift 2.x) – cannyboy