Closed animassu closed 6 years ago
The README code assumes you're adding stuff directly to main.swift or a main function. A real app would be structured differently. (With the main point being theSocketManager
should not be released by ARC.
Also, if you're new to Objective-C, I would recommend using Swift, it's much easier to learn than ObjC.
Hi, I'm completely new to objective c and currently I'm trying out this project. I'm confused on where to include this code:
" @import SocketIO;
NSURL url = [[NSURL alloc] initWithString:@"http://localhost:8080"]; SocketManager manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @YES, @"compress": @YES}]; SocketIOClient* socket = manager.defaultSocket;
[socket on:@"connect" callback:^(NSArray data, SocketAckEmitter ack) { NSLog(@"socket connected"); }];
[socket on:@"currentAmount" callback:^(NSArray data, SocketAckEmitter ack) { double cur = [[data objectAtIndex:0] floatValue];
}];
[socket connect]; "
Please and Thank you for helping.