HTML and CSS Reference
In-Depth Information
// Initialize the WebSocket object.
socket = [WebSocket
webSocketWithConfig:config
delegate:self];
// Open the WebSocket connection and
start listening for
events.
[socket open];
}
- (void)didReceiveTextMessage:(NSString
*)aMessage
{
// JavaScript event: onmessage
labelChat.text = [NSString
stringWithFormat:@"%@\r%@",
labelChat.text, aMessage];
}
- (IBAction)sendTapped:(id)sender
{
[socket sendText:textMessage.text];
}
The following figure shows the native iOS WebSocket client up-and-running!
Search WWH ::




Custom Search