ios - array created with optional -
i declaring array:
var array:[string] = [] assigning values:
array.append(uniqueid string) and pass function:
static var levels_array : [string] = [] class func setlevelsarray(arr:[string]) { gameprefrences.levels_array = arr println(gameprefrences.levels_array) } my problem when print array get:
[optional(88868658), optional(112051080), optional(95274974)]
why optional? want strings in array why "optional" added?
i come java can explain why optional created , how remove it
very actual strings "optional(88868658)", etc. have created strings optional accidentally. in above code, have array of strings, not array of optionals, , when print array of strings, don't include double-quotes (which can confusing).
it may happening here:
array.append(uniqueid string) what type uniqueid? as not used convert types. it's used cast them if possible (though should fail if that's case; i'm suspecting you're doing string interpolation somewhere).
Comments
Post a Comment