this is actually a follow up to this question: how can I convert NSArray into specific String? Bryan's answer worked for me in previous version of Swift, but now when I moved to Swift 3
, this code:
if (defaults.object(forKey: "fb_friends") != nil) {
var friends = (defaults.objectForKey("fb_friends") as! NSMutableArray)
.map{$0["id"]!!}
.joinWithSeparator(",")
friends+=",\(defaults.stringForKey("facebookId")!)"
params["friends"] = friends
}
and especially this line .map{$0["id"]!!}
throws me an error:
Type NSFastEnumerationIterator.Element (aka Any) has no subscript members
what might be the problem here?