我的应用程序出现了一个奇怪的崩溃问题,只发生在10.5上。它不会一直发生,但它会在启动时发生,似乎是在笔尖加载时。 (BWTransparentScrollView出现在崩溃报告中,但崩溃发生在initWithCoder:中,如果我从项目中删除BWToolkit,我仍然可以触发崩溃。)
事实上,我的笔尖中的两个IKImageBrowserView对象似乎存在问题。如果我从笔尖中删除它们,崩溃似乎永远不会发生(虽然我的UI搞砸了,因为这两个视图对于界面是必不可少的)。
Interface Builder不会通知我IKImageBrowserViews的任何问题。
以下是此问题的典型崩溃报告:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Application Specific Information:
objc[22521]: garbage collection is ON
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString objectForKey:]: unrecognized selector sent to instance 0x7fff704d15d0'
Thread 0 Crashed:
0 libSystem.B.dylib 0x00007fff81da5f16 __kill + 10
1 libstdc++.6.dylib 0x00007fff80b82085 dyld_stub__Unwind_DeleteException + 0
2 libobjc.A.dylib 0x00007fff80a4cadf _objc_terminate + 102
3 libstdc++.6.dylib 0x00007fff80b80425 __gxx_personality_v0 + 1259
4 libstdc++.6.dylib 0x00007fff80b8045b std::terminate() + 19
5 libstdc++.6.dylib 0x00007fff80b8054c __cxa_rethrow + 0
6 libobjc.A.dylib 0x00007fff80a4c966 objc_exception_rethrow + 0
7 com.apple.CoreFoundation 0x00007fff8218645b -[NSObject doesNotRecognizeSelector:] + 171
8 com.apple.CoreFoundation 0x00007fff82184ae4 ___forwarding___ + 756
9 com.apple.CoreFoundation 0x00007fff82184c38 _CF_forwarding_prep_0 + 232
10 com.apple.CoreText 0x00007fff839f0f43 TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*) const + 237
11 com.apple.CoreText 0x00007fff839f0dd0 TDescriptor::InitBaseFont() + 30
12 com.apple.CoreText 0x00007fff839f0d59 TDescriptor::CreateMatchingDescriptor(__CFSet const*) const + 47
13 com.apple.AppKit 0x00007fff842df2d3 __NSFontFactoryWithName + 412
14 com.apple.AppKit 0x00007fff842df075 +[NSFont fontWithName:size:] + 51
15 com.apple.imageKit 0x00000001000d246b -[IKImageBrowserView _setDefaultTextAttributes] + 288
16 com.apple.imageKit 0x00000001000d2936 -[IKImageBrowserView setAppearanceStyle:] + 42
17 com.apple.imageKit 0x00000001000d0a88 -[IKImageBrowserView _ikCommonInit] + 2122
18 com.apple.imageKit 0x00000001000d1470 -[IKImageBrowserView initWithCoder:] + 76
19 com.apple.AppKit 0x00007fff8423f750 -[NSClassSwapper initWithCoder:] + 483
20 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
21 com.apple.Foundation 0x00007fff80bc7b33 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1363
22 com.apple.Foundation 0x00007fff80bc7f91 -[NSArray(NSArray) initWithCoder:] + 385
23 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
24 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
25 com.apple.AppKit 0x00007fff841fe77a -[NSView initWithCoder:] + 367
26 com.apple.AppKit 0x00007fff842406a0 -[NSClipView initWithCoder:] + 55
27 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
28 com.apple.Foundation 0x00007fff80bc7b33 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1363
29 com.apple.Foundation 0x00007fff80bc7f91 -[NSArray(NSArray) initWithCoder:] + 385
30 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
31 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
32 com.apple.AppKit 0x00007fff841fe77a -[NSView initWithCoder:] + 367
33 com.apple.AppKit 0x00007fff84240edd -[NSScrollView initWithCoder:] + 127
34 ...onwalkin.BWToolkitFramework 0x00000001003bcb7d -[BWTransparentScrollView initWithCoder:] + 41
35 com.apple.AppKit 0x00007fff8423f750 -[NSClassSwapper initWithCoder:] + 483
36 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
37 com.apple.Foundation 0x00007fff80bc7b33 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1363
38 com.apple.Foundation 0x00007fff80bc7f91 -[NSArray(NSArray) initWithCoder:] + 385
39 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
40 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
41 com.apple.AppKit 0x00007fff841fe77a -[NSView initWithCoder:] + 367
42 com.apple.AppKit 0x00007fff841ffc92 -[NSCustomView initWithCoder:] + 651
43 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
44 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
45 com.apple.AppKit 0x00007fff841f8928 -[NSNibConnector initWithCoder:] + 409
46 com.apple.AppKit 0x00007fff841fd404 -[NSNibOutletConnector initWithCoder:] + 350
47 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
48 com.apple.Foundation 0x00007fff80bc7b33 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1363
49 com.apple.Foundation 0x00007fff80bc7f91 -[NSArray(NSArray) initWithCoder:] + 385
50 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
51 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
52 com.apple.AppKit 0x00007fff841f784c -[NSIBObjectData initWithCoder:] + 2014
53 com.apple.Foundation 0x00007fff80bc631e _decodeObjectBinary + 1214
54 com.apple.Foundation 0x00007fff80bc5de4 _decodeObject + 244
55 com.apple.AppKit 0x00007fff841f6f55 loadNib + 156
56 com.apple.AppKit 0x00007fff841f698d +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 836
57 com.apple.AppKit 0x00007fff841f6568 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 355
58 com.apple.AppKit 0x00007fff841f6299 NSApplicationMain + 286
59 ...ittleappfactory.Tagalicious 0x00000001000015cc start + 52
Thread 1:
0 libauto.dylib 0x00007fff83fcfaae Auto::MemoryScanner::scan_range(Auto::Range const&, Auto::WriteBarrier*) + 366
1 libauto.dylib 0x00007fff83fbe3df Auto::WriteBarrier::scan_ranges(void*, unsigned long, Auto::MemoryScanner&) + 607
2 libauto.dylib 0x00007fff83fd10c7 bool Auto::visitAllocatedBlocks<Auto::scan_retained_and_old_blocks_visitor>(Auto::Zone*, Auto::scan_retained_and_old_blocks_visitor&) + 343
3 libauto.dylib 0x00007fff83fd080d Auto::MemoryScanner::scan_retained_and_old_blocks() + 29
4 libauto.dylib 0x00007fff83fc95d7 Auto::Collector::check_roots() + 23
5 libauto.dylib 0x00007fff83fd0b0d Auto::MemoryScanner::scan() + 45
6 libauto.dylib 0x00007fff83fc0a40 Auto::Zone::collect(bool, void*, unsigned long long*) + 496
7 libauto.dylib 0x00007fff83fae8fd auto_collect_internal(Auto::Zone*, unsigned int) + 381
8 libauto.dylib 0x00007fff83faf3b0 auto_collection_thread(void*) + 112
9 libSystem.B.dylib 0x00007fff81d6ce8f _pthread_start + 316
10 libSystem.B.dylib 0x00007fff81d6cd51 thread_start + 13
Thread 2:
0 libSystem.B.dylib 0x00007fff81d45da2 __semwait_signal + 10
1 libGLProgrammability.dylib 0x00007fff826d057b glvmDoWork + 155
2 libSystem.B.dylib 0x00007fff81d6ce8f _pthread_start + 316
3 libSystem.B.dylib 0x00007fff81d6cd51 thread_start + 13
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007fff702717d8 rcx: 0x00007fff5fbfb628 rdx: 0x0000000000000000
rdi: 0x00000000000057f9 rsi: 0x0000000000000006 rbp: 0x00007fff5fbfb640 rsp: 0x00007fff5fbfb628
r8: 0x00007fff5fbfb1b0 r9: 0x0000000000000000 r10: 0x00007fff81d7de36 r11: 0x0000000000000206
r12: 0x00007fff821aea28 r13: 0x0000000000000000 r14: 0x00007fff80a56d00 r15: 0x00007fff7032d0a0
rip: 0x00007fff81da5f16 rfl: 0x0000000000000206 cr2: 0x00007fff70093028
知道会发生什么事吗?
答案 0 :(得分:0)
唉。我尝试了很多东西来尝试解决这个问题。我尝试从头开始重新创建新的IKImageBrowserViews(如果xib文件本身被某种程度上损坏了)。我尝试确保我的自定义IKImageBrowserView类(我在Interface Builder中设置它们的类)没有导致问题。
最后,我从xib中删除了IKImageBrowserViews,并以编程方式创建它们。 10.5上的崩溃消失了。它不是太很难,但它是解决启动崩溃问题的唯一解决方案。