Closed
Description
[REQUIRED] Step 1: Describe your environment
- Xcode version: 13.0
- Firebase SDK version:8.9.1
- Installation method:
Swift Package Manager
- Firebase Component: Database
- Target platform(s):
iOS
[REQUIRED] Step 2: Describe the problem
- It appeared when we started using the SDK as dependency of one of our SPM package, before, we were using cocoapods and it was fine.
- FirebaseDatabase entities get mapped when app is launched and it intermittently crashes in
FUtilities.intForString
Steps to reproduce:
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
- Happens when we launch the app since we starting mapping entities immediately
- Attached (crashlog.txt) is the crash report
If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.
Relevant Code:
// TODO(you): code here to reproduce the problem
+ (NSNumber *)intForString:(NSString *)string {
static NSCharacterSet *notDigits = nil;
if (!notDigits) {
notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
}
if ([string rangeOfCharacterFromSet:notDigits].length == 0) {
NSInteger num;
NSScanner *scanner = [NSScanner scannerWithString:string];
if ([scanner scanInteger:&num]) {
return [NSNumber numberWithInteger:num];
}
}
return nil;
}