Sunday, 15 September 2013

ios - Array from dictionary keys in swift -



ios - Array from dictionary keys in swift -

trying fill array strings keys in dictionary in swift.

var componentarray: [string] allow dict = nsdictionary(contentsoffile: nsbundle.mainbundle().pathforresource("components", oftype: "plist")!) componentarray = dict.allkeys

this returns error of: 'anyobject' not identical string

also tried

componentarray = dict.allkeys string

but get: 'string' not convertible [string]

componentarray = array(dict.keys)

ios arrays xcode dictionary swift

No comments:

Post a Comment