Skip to content

NSCFArray and NSCFDictionary ? #69

@obsobsobs

Description

@obsobsobs

the data that i become from the parser are always of type NSCFArray and NSCFDictionary. It's not easy to modify the content of this classes.

my Question is: why you use NSJSONReadingOptions.AllowFragments?

with NSJSONReadingOptions.MutableContainers it works like a charm ... i get then NSArrayM and NSDictionaryM

/************ class SocketParser *********/

// Parses data for events
static func parseData(data:String) -> AnyObject? {
var err:NSError?
let stringData = data.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
let parsed:AnyObject? = NSJSONSerialization.JSONObjectWithData(stringData!,
options: NSJSONReadingOptions.AllowFragments, error: &err)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions