Browse Source

IOS-2794 This could work

IOS-2794
Dirk Zimmermann 1 year ago
parent
commit
dce3db0fee
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      pantomime-lib/Framework/Pantomime/NSData+Extensions.m

+ 8
- 1
pantomime-lib/Framework/Pantomime/NSData+Extensions.m View File

@ -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