想着给已有项目配置修复一下国际化问题,刚开始还能运行后续运行报错如下,各种方法都没有找到原因。代码基本没有任何改动,后续发现已上线的测试版本也无法运行。目前定位应该是在入口的
@main
开始发生问题,也怀疑是 Localizable.strings 的问题,但实际上没有任何修改记录。
2023-07-16 04:13:48.942021+0800 PDFPhoto Protector[9808:134268] -[NSTaggedPointerString count]: unrecognized selector sent to instance 0xb4fad2e3e13e9cba
2023-07-16 04:13:48.942928+0800 PDFPhoto Protector[9808:134268] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString count]: unrecognized selector sent to instance 0xb4fad2e3e13e9cba'
*** First throw call stack:
(
0 CoreFoundation 0x00000001a319b154 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x00000001a2cba4d4 objc_exception_throw + 60
2 CoreFoundation 0x00000001a3242110 -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00000001a31030a0 ___forwarding___ + 1600
4 CoreFoundation 0x00000001a31029a0 _CF_forwarding_prep_0 + 96
5 CoreFoundation 0x00000001a31df09c _CFLocaleCreateLocaleIdentifierForAvailableLocalizations + 76
6 CoreFoundation 0x00000001a30df058 _CFLocaleCopyCurrentGuts + 816
7 CoreFoundation 0x00000001a30decfc +[NSLocale currentLocale] + 16
8 Foundation 0x00000001a4044dcc -[NSUserDefaults(NSUserDefaults) init] + 1136
9 Foundation 0x00000001a4044910 +[NSUserDefaults(NSUserDefaults) standardUserDefaults] + 64
10 AppKit 0x00000001a630c804 +[NSApplication initialize] + 88
11 libobjc.A.dylib 0x00000001a2caaff0 CALLING_SOME_+initialize_METHOD + 24
12 libobjc.A.dylib 0x00000001a2caac9c initializeNonMetaClass + 904
13 libobjc.A.dylib 0x00000001a2cc50e8 _ZL24initializeAndMaybeRelockP10objc_classP11objc_objectR12locker_mixinIN9lockdebug10lock_mixinI16objc_lock_base_tEEEb + 156
14 libobjc.A.dylib 0x00000001a2caa5c4 lookUpImpOrForward + 884
15 libobjc.A.dylib 0x00000001a2ca9f64 _objc_msgSend_uncached + 68
16 AppKit 0x00000001a630c59c NSApplicationMain + 376
17 PDFPhoto Protector 0x0000000100bd7618 $sSo21NSApplicationDelegateP6AppKitE4mainyyFZ + 40
18 PDFPhoto Protector 0x0000000100bd75e0 $s18PDFPhoto_Protector11AppDelegateC5$mainyyFZ + 44
19 PDFPhoto Protector 0x0000000100bd76b0 main + 28
20 dyld 0x00000001a2cebf28 start + 2236
)
libc++abi: terminating due to uncaught exception of type NSException
(lldb)
@main
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.