我对Pidev说几句新话,当我在本法典中称CFSocketConnect ToAddress时,我一直没有得到公认的甄选者。 我认为,我这样做可能是一种基本条件。 任何想法?
这是我发现的完全错误。
NSInvalidArgumentException unrecognized selector sent to instance 0x3922170
0x3922170为电话。
- (BOOL)connect
{ CFSocketRef mySocket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM,IPPROTO_UDP, 0, socketCallback, NULL);
@try {
CFDataRef data = (CFDataRef)[_netService addresses];
CFSocketConnectToAddress(mySocket, data, 500);
iii
@catch (NSException * e) {
NSLog([e name]);
NSLog([e reason]);
iii
//char joke[] = "Why did the chicken cross the road?";
//CFSocketError err = CFSocketSendData(mySocket, joke, (strlen(joke)+1), 10);
return true;
iii
void socketCallback ( CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) {
iii