当前位置: 代码迷 >> Iphone >> 关于iOS udp 通信的有关问题
  详细解决方案

关于iOS udp 通信的有关问题

热度:365   发布时间:2016-04-25 06:31:59.0
关于iOS udp 通信的问题
建立了一个socket,当加入组播组之后,在-(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port
中接收到回信之后就开始单步调试,调试至[self scheduleDequeueReceive];
然后跳至这个方法
- (void)scheduleDequeueReceive
{
if((theFlags & kDequeueReceiveScheduled) == 0)
{
theFlags |= kDequeueReceiveScheduled;
[self performSelector:@selector(maybeDequeueReceive) withObject:nil afterDelay:0 inModes:theRunLoopModes];
}
}
中的[self performSelector:@selector(maybeDequeueReceive) withObject:nil afterDelay:0 inModes:theRunLoopModes];
这步,报如下错误:
*** -[__NSArrayI count]: message sent to deallocated instance 0x7830e90

请教该如何解决?十万火急!!!

------解决方案--------------------
把-(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port里面的代码贴出来看看再说。你那个错误是使用了已经被释放的内存。别人的库不存在这样的问题,你没改里面的代码的话,就不用把别人库里面的代码帖出来了。
  相关解决方案