robbiehanson/CocoaAsyncSocket — pull request #91 by funkensturm (2012-10-12 21:24:12+00:00)
Title: ARC compiling fix: undeclared selector "suspendSend4Source"

(NOTE: Sorry for the duplicate pull request. I mean to propose my [90-arc-fix](https://github.com/funkensturm/CocoaAsyncSocket/tree/90-arc-fix) branch, not my master.)

I'm using CocoaAsyncSocket as a cocoapods dependency. As soon as I try to lint my own pod, yours will be cloned and compiled first. However, the compiling does not succeed:

```
-> CocoaGameSocket (0.0.1)
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1727:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend4Source' [4]
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1732:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend4Source' [4]
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1737:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend4Source' [4]
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1838:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend6Source' [4]
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1843:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend6Source' [4]
- ERROR | XCODEBUILD > CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m:1848:5: error: receiver type 'GCDAsyncUdpSocket' for instance message does not declare a method with selector 'suspendSend6Source' [4]
```

It's essentially because the `suspendSend4Source` and `suspendSend6Source` selectors are not declared in the header file (naturally, because they are just internal methods), yet they are referenced inside the implementation *before* they are declared.

How do you succeed in building CocoaAsyncSocket after all? I mean, you must have run into this or you have different compile options or cocoapods does something different on my machine than on yours...

At any rate, moving around these two methods a little higher should solve the issue, shouldn't it? Alternatively they could be declared in the header file but that would be rather uncommon for internal methods I guess.