socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

Property 'defaultSocket' not found on object of type 'SocketManager *'

Open jfalexvijay opened this issue 3 years ago • 7 comments

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.

jfalexvijay avatar Jun 16 '21 05:06 jfalexvijay

I have the same error ^_^

ldbfrank avatar Jun 19 '21 16:06 ldbfrank

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 *

AVAlex avatar Jun 29 '21 09:06 AVAlex

Did anyone here find a solution?

flikQ avatar Jul 06 '21 20:07 flikQ

FIX pushed on #1370

berinhardt avatar Aug 09 '21 15:08 berinhardt

Will it be merged into the official version?

Tomomir avatar Nov 30 '22 11:11 Tomomir

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() {

onozuka avatar Feb 17 '23 10:02 onozuka

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

FullYuzhou avatar Apr 02 '23 02:04 FullYuzhou