Open Skyb0rg opened 5 years ago
Hi i have a solution for this problem:
create dealloc and set delegate to nil
-(void)dealloc {
_delegate = nil;
}
update: -(void)characteristicDidUpdateValue
{
@try {
NSData* value = _characteristic.value;
[_buffer appendData:value];
@synchronized(self) {
[self.delegate stream:self handleEvent:NSStreamEventHasBytesAvailable];
}
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}
}
tested about 8 hours, this error didn´t happend again, but got another error (i will report it in another Issue )
maybee we only need to update this code.
@synchronized(self) {
[self.delegate stream:self handleEvent:NSStreamEventHasBytesAvailable];
}
do the same in -(void)characteristicDidWriteValue
-(void)characteristicDidWriteValue
{
@try {
@synchronized(self) {
[self.delegate stream:self handleEvent:NSStreamEventHasSpaceAvailable];
}
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}
}
Hope this helps someone!!!
i will create a push-request the next days.
@synchronized(self) is not the solution. Now i test with the serial dispatchqueue in the transporter.
created pull request for the solution. #26
sometimes i get this error, maybee you can help me or improve the pod?