socket.io-client-swift
socket.io-client-swift copied to clipboard
Property 'defaultSocket' not found on object of type 'SocketManager *'
Hello,
Mac OS: 11.2.3 Xcode: 12.5 SocketIO version: 16.0.1
I am trying to update socket io for my old iPhone project.
manager = [[SocketManager alloc] initWithSocketURL...]; socket = self.manager.defaultSocket; // ERROR: Property 'defaultSocket' not found on object of type 'SocketManager *' [self.socket connect]; // ERROR: No visible @interface for 'SocketIOClient' declares the selector 'connect'
ERROR: Property 'defaultSocket' not found on object of type 'SocketManager *' ERROR: No visible @interface for 'SocketIOClient' declares the selector 'connect'
Not sure why I am getting the above error.. Plz guide me how to fix it..
Thanks.
I have the same error ^_^
Also me...
self.manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @NO}];
self.socket = self.manager.defaultSocket; // ERROR: Property 'defaultSocket' not found on object of type 'SocketManager *
Did anyone here find a solution?
FIX pushed on #1370
Will it be merged into the official version?
Since the pull request has not been merged, I solved it by specifying the branch in the Pod.
pod 'Socket.IO-Client-Swift', :git => 'https://github.com/berinhardt/socket.io-client-swift', :branch => 'fix/ObjC'
and fix. SocketIOClient.swift
@objc open func connect() {
connect(nil)
}
↓
@objc open func connect() {
connect(withPayload: nil)
}
open func disconnect() {
↓
@objc open func disconnect() {
Since the pull request has not been merged, I solved it by specifying the branch in the Pod.
pod 'Socket.IO-Client-Swift', :git => 'https://github.com/berinhardt/socket.io-client-swift', :branch => 'fix/ObjC'
and fix. SocketIOClient.swift
@objc open func connect() { connect(nil) } ↓ @objc open func connect() { connect(withPayload: nil) } open func disconnect() { ↓ @objc open func disconnect() {
Hope to improve oc a little bit,emit send no response,emitWithAck not applicable