fix for 1.2

This commit is contained in:
Erik 2015-03-21 11:44:49 -04:00
parent 504d0fbd18
commit 8b3e4a2c43
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class SocketPacket {
}
func getEvent() -> String {
return data?.removeAtIndex(0) as String
return data?.removeAtIndex(0) as! String
}
func addData(data:NSData) -> Bool {
@ -226,7 +226,7 @@ class SocketPacket {
// if it is a placeholder for data
if let str = value as? String {
if let num = str["~~(\\d)"].groups() {
newDict[key as! String] = self.datas[num[1].toInt()!]
newDict[key as! String] = self.binary[num[1].toInt()!]
} else {
newDict[key as! String] = str
}

View File

@ -93,7 +93,7 @@ class SocketParser {
let d = String(arr[++i...arr.count-1])
let noPlaceholders = d["(\\{\"_placeholder\":true,\"num\":(\\d*)\\})"] ~= "\"~~$2\""
let data = SocketParser.parseData(noPlaceholders) as [AnyObject]
let data = SocketParser.parseData(noPlaceholders) as! [AnyObject]
return SocketPacket(type: SocketPacketType(str: type), data: data,
nsp: nsp, placeholders: placeholders, id: id)