#import "NSString+Safe.h"
@implementation NSString (Safe)
- (NSTimeInterval)timeIntervalSinceReferenceDate {
NSString *stack = [NSThread callStackSymbols].description;
NSLog(@"🔴 非法调用详情:\n"
@"- 调用者类: %@\n"
@"- 内存地址: %p\n"
@"- 调用堆栈: %@",
[self class], self, stack);
return 0;
}
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)date {
NSLog(@"⚠️ 拦截非法调用2: [%@ %@]", [self class], NSStringFromSelector(_cmd));
return 0;
}
@end
Using NSString protection can solve this problem. But the root cause is that InputAnalytics (system keyboard service) called timeIntervalSinceReferenceDate in the asynchronous queue (dispatch_async).
Topic:
App & System Services
SubTopic:
General
Tags: