i'm always getting an error (see picture) while trying to establish a websocket connection.
my target is ios 6.0, using ARC and this is my code:
NSURL* url = [[NSURL alloc] initWithString:uriString];
webSocket = [[SRWebSocket alloc] initWithURL:url];
webSocket.delegate = self;
I am having the same issue, I'm looking into fixing it. I'll post if I figure something out.
Ok, I got it working. You need to make sure that your socket isn't getting deallocated, to do this use the __strong tag when making your delegate instance.
@7imbrook, how about making delegate as weak reference? All my crashes (with SignalR-ObjC lib) appears on sending message to assigned self.delegate
diff --git a/Pods/SocketRocket/SocketRocket/SRWebSocket.h b/Pods/SocketRocket/SocketRocket/SRWebSocket.h
index 2d40bb1..4816454 100644
@@ -36,7 +36,7 @@ extern NSString *const SRWebSocketErrorDomain;
@interface SRWebSocket : NSObject <NSStreamDelegate>
-@property (nonatomic, assign) id <SRWebSocketDelegate> delegate;
+@property (nonatomic, weak) id <SRWebSocketDelegate> delegate;
@property (nonatomic, readonly) SRReadyState readyState;
@property (nonatomic, readonly, retain) NSURL *url;
Make WebSocket Delegate a weak reference facebook/SocketRocket#79
Doing some housekeeping. Please reopen if still relevant