Swift: Creating an NSXMLNode



I'm trying to create an NSXMLNode using Swift. This seems like it should be pretty straightforward based on the class reference (and Xcode's autocompletion):



var anAttribute: NSXMLNode = NSXMLNode.attributeWithName("name", stringValue: "string")


But I get an error: "Missing argument for parameter 'URI' in call."


I then try:



var anAttribute: NSXMLNode = NSXMLNode.attributeWithName("name", URI: "uri", stringValue: "string")


Which produces the equally beguiling error: "Extra argument 'URI' in call."


Can anyone tell me what's going on here?


No comments:

Post a Comment