pkyeck / socket.IO-objc

socket.io v0.7.2 — 0.9.x for iOS and OS X
MIT License
1.97k stars 439 forks source link

SocketIOPacket parsing problem #184

Closed fwhenin closed 10 years ago

fwhenin commented 10 years ago

I have the packet data coming in on a recieveEvent delegate.

getting dictionary of packet.dataAsJSON works, and doing an NSLog on that looks like this

args = (
{
id = "123";
name = "John Doe";
status = "Yeah";
}
};
name = "JoinedChat";

First, I'm confused as to why it has '=' and ';' instead of ':' and ','

Second, when I getObjectAtKey:@"args", I don't get another dictionary of 3 objects , I get a dictionary of 1 object...and there's no keys...if I parse it as an Array, and get objectsAtIndex:0, I'm getting 3 objects but not dictionaries, I'm trying to access the data in there, but it isn't working. help please

pkyeck commented 10 years ago

right now, you can do this to access the data:

[[packet.args objectAtIndex:0] objectForKey:@"status"]

I should add a more convenient method for this.

fwhenin commented 10 years ago

that's returning nil :-/, but I see it in debug and NSLog the packet.args, but not when I do objectForKey

fwhenin commented 10 years ago

got it...closing this