Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Neither Mac OS X 10.8 and iOS 6 require a dispatch_release under ARC #55

wants to merge 1 commit into from

9 participants


If you use SocketRocket as a library (and not add the files to your existing build target) this shouldn't be a problem.

It has OS_OBJECT_USE_OBJC_RETAIN_RELEASE=0 set as a preprocessor definition. I recommend keeping it in a separate target than your main executable.



I had the same problem including only socketrocket files, so I followed your advice including the whole socketrocket project in my iOS 6 project. I included libsocketrocket.a in link binaries and added -ObjC in linker flags and still, I can't import , it says not found.. any advice ?



I had to modify the "User Header Search Paths" to include the SocketRocket folder. That fixed the include issue.


This problem is still....:-(

@numbcoder numbcoder referenced this pull request in NetEase/pomelo-cn

iOS demo 改成iOS6后跑不起来了 #33


Is there a plan to fix this? I also tried to add SocketRocket as a library with no success.


I've successful fixed the problem.

How can I add some fotos to comments :(
ok, i just write down it .

'Build Settings' --'Apple LLVM compiler 4.1 - Preprocessing' -'Preprocessor Macros' --'Debug' add
the same place

Maybe also to add, but im not sure that, you can try as in the follows if the problem is still.

'Build Settings' --'Apple LLVM compiler 4.1 - Language' - 'Other C Flags' --'Release' --


Any plans to fix this? It breaks using SocketRocket as a CocoaPods in an iOS6 project.


Hey All,
I have set up MyProject and SocketRocket in my workspace but SocketRocket not building its Products. All the products for SocketRocket are red even though the build is successful. Mind letting know what I am doing wrong?



I have the same issue as @megaplow. Any suggestions?


Sorry I didn't follow up,
In the build targets, I had to set the parameters in the Architectures section. I am only building the OSX version to that is working, the rest are still red, but not an issue.

Great framework!


Doing some housecleaning. If this is still an issue please fix conflicts and reopen. We'll do a better job of reviewing quickly this time, I promise.

@dfed dfed closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 36 additions and 4 deletions.
  1. +36 −4 SocketRocket/SRWebSocket.m
40 SocketRocket/SRWebSocket.m
@@ -36,10 +36,42 @@
#import "base64.h"
#import "NSData+SRB64Additions.h"
+ * Neither Mac OS X 10.8 and iOS 6 require a dispatch_release under ARC
+ */
+#if ! __has_feature(objc_arc)
+ #define SAFE_DispatchQueueRelease(__v) (dispatch_release(__v));
+ // -fobjc-arc
+ // Compiling for iOS
+ // iOS 6.0 or later
+ #define SAFE_DispatchQueueRelease(__v)
+ #else
+ // iOS 5.X or earlier
+ #define SAFE_DispatchQueueRelease(__v) (dispatch_release(__v));
+ #endif
+ #else
+ // Compiling for Mac OS X
+ // Mac OS X 10.8 or later
+ #define SAFE_DispatchQueueRelease(__v)
+ #else
+ // Mac OS X 10.7 or earlier
+ #define SAFE_DispatchQueueRelease(__v) (dispatch_release(__v));
+ #endif
+ #endif
typedef enum {
SROpCodeTextFrame = 0x1,
SROpCodeBinaryFrame = 0x2,
- //3-7Reserved
+ //3-7Reserved
SROpCodeConnectionClose = 0x8,
SROpCodePing = 0x9,
SROpCodePong = 0xA,
@@ -309,7 +341,7 @@ - (void)_SR_commonInit;
_workQueue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
_callbackQueue = dispatch_get_main_queue();
- dispatch_retain(_callbackQueue);
+ SAFE_DispatchQueueRelease(_callbackQueue);
_readBuffer = [[NSMutableData alloc] init];
_outputBuffer = [[NSMutableData alloc] init];
@@ -329,8 +361,8 @@ - (void)dealloc
[_inputStream close];
[_outputStream close];
- dispatch_release(_callbackQueue);
- dispatch_release(_workQueue);
+ SAFE_DispatchQueueRelease(_callbackQueue);
+ SAFE_DispatchQueueRelease(_workQueue);
if (_receivedHTTPHeaders) {
Something went wrong with that request. Please try again.