var currentNodeName:String!
func parser(parser: NSXMLParser, didStartElement elementName: String!, namespaceURI: String!, qualifiedName qName: String!, attributes attributeDict: [NSObject : AnyObject]!)
{
currentNodeName = elementName
if elementName=="background"
{
let stringx = attributeDict["x"]! as String
//if let n = NSNumberFormatter().numberFromString(stringx)
//{
// let x = CGFloat(n)
//}
//var y = attributeDict["y"]! as CGFloat
//var width = attributeDict["width"]! as CGFloat
var Height = attributeDict["Height"]! as String
backgroundRect = CGRectMake(0,0,0,0)
}
}
从xml里面读出来都是string,怎么转换呢?