Dictionary cannot be deleted from Objective-C & # 8594; Problems in Swift

I wrap some objective-c code in swift, and I try to get the result set as a dictionary, and then pack each dictionary (equivalent to a string from db) into an array. But I get the error "The dictionary cannot connect to Objective-C." I read this from an apple, but still I am not moving towards a solution. Any ideas? Thank.

This is the line where the error is:

resultsArray.append(resultSet!.resultDictionary() as Dictionary<String,String>)
+4
source share
1 answer

Of the amazing robertmryan referred here for convenience:

, ( [NSNull null]) ( NSNumber). , resultsArray :

var resultsArray = Array<Dictionary<String,AnyObject>>()

:

var resultsArray = [[String: AnyObject]]()

, ,

resultsArray.append(resultSet!.resultDictionary() as Dictionary<String, AnyObject>)

resultsArray.append(resultSet!.resultDictionary() as [String: AnyObject])
+4

All Articles