IOS-2794 This could work

IOS-2794
Dirk Zimmermann 2 years ago
parent 3927552521
commit dce3db0fee

@ -441,7 +441,14 @@ static const char *hexDigit = "0123456789ABCDEF";
{
const char *theBytes = [self bytes];
const char *newBytes = theBytes + range.location;
return [NSData dataWithBytesNoCopy:(void *) newBytes length:range.length];
// Let the NSData point to existing bytes without copy,
// and don't do anything to free them
return [[NSData alloc] initWithBytesNoCopy:(void *) newBytes
length:range.length
deallocator:^(void * _Nonnull bytes, NSUInteger length) {
// ignore, don't free anything
}];
}
- (NSData *)dataByTrimmingWhiteSpaces

Loading…
Cancel
Save