建立了一个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里面的代码贴出来看看再说。你那个错误是使用了已经被释放的内存。别人的库不存在这样的问题,你没改里面的代码的话,就不用把别人库里面的代码帖出来了。