Hello,
We have a legacy project that has a NSData category. This category is used to add a new method called "base64EncodedString" that we use for a custom base 64 encoding.
Up until iOS 17, everything worked and we had no issue with it. This how we use it:
NSString* text = @"This is the string we want to encode";
NSString* strArrRequests64 = [[text dataUsingEncoding:NSUTF8StringEncoding] base64EncodedString];
We have a breakpoint in our implementation of base64EncodedString
- (NSString *)base64EncodedString
{
size_t outputLength;
char *outputBuffer = ....;
NSString *result =
[[[NSString alloc]
initWithBytes:outputBuffer
length:outputLength
encoding:NSUTF8StringEncoding]
autorelease];
free(outputBuffer);
return result;
}
The strange thing is that we use this method for several calls in our app. In 80% of the cases it triggers the breakpoint and the encoding works as intended, but some calls do not and the encoding does not happen.
We have checked the class of [text dataUsingEncoding:NSUTF8StringEncoding]
and for all calls is "NSMutableConcreteData".
This is a breaking change for iOS17 and it affects a lot of our clients. We have a solution for this particular case, but there are more categories inside our library which can be affected by this issue.
Please advise.