xcode 应用程序崩溃 - EXC_CRASH (SIGABRT) - iOS 4.3 - Three20
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5918957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Application Crash - EXC_CRASH (SIGABRT) - iOS 4.3 - three20
提问by Nanz
I have included three20 library in my project. I am making use of the TTThumbsViewController. Everything was working great until i upgraded to Xcode 3.2.6 and iOS 4.3. The grid of photos appears fine, but as soon as i click on one the thumbs, the app crashes. I am certain that this is not a memory issue. It works fine on the simulator though. Here is the crash report :
我在我的项目中包含了 Three20 库。我正在使用 TTThumbsViewController。一切都很好,直到我升级到 Xcode 3.2.6 和 iOS 4.3。照片网格看起来不错,但只要我点击一个拇指,应用程序就会崩溃。我确定这不是内存问题。不过它在模拟器上运行良好。这是崩溃报告:
Incident Identifier: 3C63956F-F718-468F-B113-116E457DEB4E
CrashReporter Key: 32180af33b999869f98369f8d85412b799a88fdb
Hardware Model: iPhone3,1
Process: MyApp [15071]
Path: /var/mobile/Applications/13C32157-F4CA-44BC-BB8F-D9A9FE9EAE38/MyApp.app/MyApp
Identifier: MyApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]Date/Time: 2011-05-06 21:48:06.042 -0500
OS Version: iPhone OS 4.3 (8F190)
Report Version: 104Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00011a1c __pthread_kill + 8
1 libsystem_c.dylib 0x000333b4 pthread_kill + 52
2 libsystem_c.dylib 0x0002bbf8 abort + 72
3 libstdc++.6.dylib 0x00044a64 __gnu_cxx::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x0000606c _objc_terminate + 104
5 libstdc++.6.dylib 0x00042e36 _cxxabiv1::_terminate(void (*)()) + 46
6 libstdc++.6.dylib 0x00042e8a std::terminate() + 10
7 libstdc++.6.dylib 0x00042f5a __cxa_throw + 78
8 libobjc.A.dylib 0x00004c84 objc_exception_throw + 64
9 CoreFoundation 0x0009e48a +[NSException raise:format:arguments:] + 62
10 CoreFoundation 0x0009e4c4 +[NSException raise:format:] + 28
11 QuartzCore 0x00001616 CALayerSetPosition(CALayer*, CA::Vec2 const&, bool) + 134
12 QuartzCore 0x00001584 -[CALayer setPosition:] + 32
13 QuartzCore 0x000014d0 -[CALayer setFrame:] + 384
14 UIKit 0x0000544e -[UIView(Geometry) setFrame:] + 182
15 MyApp 0x00078366 -[TTPhotoView layoutSubviews] (TTPhotoView.m:221)
16 UIKit 0x000055f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 20
17 CoreFoundation 0x0000befc -[NSObject(NSObject) performSelector:withObject:] + 16
18 QuartzCore 0x00002bae -[CALayer layoutSublayers] + 114
事件标识符:3C63956F-F718-468F-B113-116E457DEB4E
CrashReporter始终密钥:32180af33b999869f98369f8d85412b799a88fdb
硬件型号:iPhone3,1
工艺:MyApp的[15071]
的路径:/var/mobile/Applications/13C32157-F4CA-44BC-BB8F-D9A9FE9EAE38/MyApp.app /MyApp
标识符:MyApp
版本:??? (???)
代码类型:ARM(本机)
父进程:launchd [1]日期/时间:2011-05-06 21:48:06.042 -0500
操作系统版本:iPhone OS 4.3 (8F190)
报告版本:104异常类型:EXC_CRASH (SIGABRT)
异常代码:0x00000000、0x00000000崩溃
线程:0线程0名:调度队列:com.apple.main线程
线程0毁损:
0 libsystem_kernel.dylib 0x00011a1c __pthread_kill + 8
1 libsystem_c.dylib 0x000333b4 pthread_kill + 52
2 libsystem_c.dylib 0x0002bbf8中止+ 72
。3 ++的libstdc 6.dylib 0x00044a64 __gnu_cxx ::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x0000606c _objc_terminate + 104
5 libstdc++.6.dylib 0x00042e36 _cxxabiv1::_terminate(void (*)())
.60st0d++.60st04dc6ter () + 10
7 libstdc++.6.dylib 0x00042f5a __cxa_throw + 78
8 libobjc.A.dylib 0x00004c84 objc_exception_throw + 64
9 CoreFoundation 0x0009e48a +[NSException raise:format:arguments:] + 62
10 CoreFoundation 0x0009e4c4 +[NSException raise:format1:] +
260zCAYer100zCA100zCal const&, bool) + 134
12 QuartzCore 0x00001584 -[CALayer setPosition:] + 32
13 QuartzCore 0x000014d0 -[CALayer setFrame:] + 384
14 UIKit 0x0000544e -[我的App000544e]
-[UIApp206View] -[UI706View]-[UI706View] 布局图066View 0x000014d0 (TTPhotoView.m:221)
16 UIKit 0x000055f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 20
17 CoreFoundation 0x0000befc -[NSObject(NSObject) performSelector:withObject:] + 16
18 QuartzCore 0x00002bae + 20 17 CoreFoundation
Any ideas anyone ?
任何人的想法?
Thanks
谢谢
回答by Adam Rosenfield
The function CALayerSetPosition
is throwing an exception of type NSException
, and nobody is catching it, so your application is getting terminated. Try adding this code around the call to -[UIView(Geometry) setFrame:]
inside the function -[TTPhotoView layoutSubviews]
(which should be on line 221 of TTPhotoView.m):
该函数CALayerSetPosition
正在抛出类型为 的异常NSException
,但没有人捕捉到它,因此您的应用程序将被终止。尝试-[UIView(Geometry) setFrame:]
在函数内部的调用周围添加此代码-[TTPhotoView layoutSubviews]
(应该在 TTPhotoView.m 的第 221 行):
@try
{
[myUIView setFrame:someFrame];
}
@catch(NSException *exception)
{
NSLog(@"Caught exception: %@", exception);
}
That should give you more information about why the exception is being thrown; most likely, you're passing an invalid parameter or something.
这应该会给你更多关于为什么抛出异常的信息;最有可能的是,你传递了一个无效的参数或其他东西。
回答by Nanz
Yes..It was a NaN that was being passed. Basically if you use the constructor(MockPhotoSource class) which by default assigns a null value to the caption variable, it throws this exception. So i used the other constructor and gave a blank value to the caption parameter
是的..这是一个正在传递的 NaN。基本上,如果您使用默认情况下为标题变量分配空值的构造函数(MockPhotoSource 类),则会引发此异常。所以我使用了另一个构造函数,并给了标题参数一个空白值
回答by Andrew Flynn
I also just recently saw this exception and per what Adam said, I believe the problem is that a NaN is being passed in as a parameter and this is throwing the exception. If it's the same problem I was facing, I was able to comment the line out to just get around the problem (AFAICT the line is only dealing with the loading spinner progress indicator). So if you're willing to live w/o that, you can get around it
我最近也看到了这个异常,根据 Adam 所说,我相信问题在于 NaN 作为参数传入,这引发了异常。如果这是我面临的相同问题,我可以注释掉该行以解决问题(AFAICT 该行仅处理加载微调进度指示器)。所以如果你愿意没有那个生活,你可以绕过它