导致奇怪崩溃的方法

发布于 2024-08-21 16:36:54 字数 14991 浏览 6 评论 0原文

我正在构建这个应用程序,但遇到了一些以前从未见过的问题。

  1. 当我运行下面的方法时,该应用程序崩溃,该方法连接到 UIButton 作为触发器。因此,当我按下按钮时,它会进行打印,然后模拟器就会崩溃到跳板上。如果我从跳板再次启动应用程序,它不会到达打印方法,如果我从 Xcode 重建它,它会到达,然后像以前一样立即崩溃。

  2. 通常调试控制台中有一些信息,我至少可以得到关于正在发生的事情的线索,但似乎没有太多信息。我注意到的一件事是,有一些关于辅助功能被打开的信息,或者当应用程序最初在模拟器中启动时的一些信息,我不记得它是否始终存在:

2010-02-18 10:35:19.024 现金[497:207] ****** 辅助功能状态已更改:于 2010-02-18 10:35:19.134 现金[497:207] ********** 加载 AX 对于:com.yourcompany.Cash ************

版权所有 2010 尼古拉斯·伊安诺 (Nicholas Iannone):

-(IBAction) logTransaction {

NSIndexPath *indexPath = [[NSIndexPath alloc] init];
indexPath = [self.categoryTableView indexPathForSelectedRow];

NSInteger selectedCategory = indexPath.row;
[indexPath release];
NSString *categoryString = [[NSString alloc] init];
categoryString = [self.categoryArray objectAtIndex:selectedCategory];
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 1000.0f;
[locationManager startUpdatingLocation];
double x = 10.0;
double y = 10.0;
NSString *descriptionString = [[NSString alloc] init];

descriptionString = descriptionField.text;
//[locationManager stopUpdatingLocation];

Transaction *newTransaction = [[Transaction alloc] initWithAmount:    [self.amountField.text integerValue] 
                                                      description: descriptionString 
                                                         category: categoryString   
                                                        locationX: x 
                                                        locationY: y];

                                      [categoryString release];
[newTransaction print];

 //log transaction here...

[newTransaction release];

这是控制台输出:

2010年2月18日 10:35:19 AM 现金[497] ********** 加载 AX 对于:com.yourcompany.Cash ************ 2010年2月18日 10:35:28 AM现金[497] 0.000000,sddssd,零食,2010-02-18 10:35:28 -0800,10.000000,10.000000 2010年2月18日 10:35:28 AM com.apple.launchd.peruser.501[91](UIKitApplication:com.yourcompany.Cash[0x9148][497]) 作业似乎崩溃了: 分段错误 2/18/10 10:35:28 AM SpringBoard[482] 应用程序“现金” 异常退出并显示信号 11: 分段错误 2/18/10 10:35:28 AM ReportCrash[491] 已保存的崩溃报告 现金[497]版本??? (???) 到 /Users/knyck2/Library/Logs/DiagnosticReports/Cash_2010-02-18-103528_Nicholas-Iannones-MacBook-Pro.crash

这是崩溃日志:

流程:现金 [497] 路径:
/用户/knyck2/库/应用程序 支持/iPhone 模拟器/3.2/应用程序/F54FA00C-9E77-4B9A-8774-2D5B5488A1BA/Cash.app/Cash 标识符:现金版本:
??? (???) 代码类型:X86 (本机)父进程:launchd [91]

日期/时间:2010-02-18 10:35:28.631 -0800 操作系统版本:
Mac OS X 10.6.2 (10C540) 报告 版本:6

异常类型:EXC_BAD_ACCESS (SIGSEGV) 异常代码: KERN_INVALID_ADDRESS 位于 0x0000000014600478 崩溃的线程:0 调度队列:com.apple.main-thread

应用程序特定信息: objc_msgSend() 选择器名称:release iPhone 模拟器 3.2 (193),iPhone 操作系统 3.2(7B298克)

线程 0 崩溃:调度队列: com.apple.main-thread 0
libobjc.A.dylib
0x9805aedb objc_msgSend + 27 1
UIKit
0x002b4a19 _UIApplicationHandleEvent + 8468 2 图形服务 0x02f1f2a8 PurpleEventCallback + 1576 3 核心基础
0x026bb87e CFRunLoopRunSpecific + 4094 4 核心基础
0x026ba878 CFRunLoopRunIn模式 + 88 5 图形服务
0x02f1da4d GSEventRunModal + 217 6
图形服务
0x02f1db12 GSEventRun + 115 7 UIKit 0x002b265d UIApplicationMain + 1134 8 现金
0x00002648 主 + 102 (主.m:13) 9
现金
0x000025b6开始+54

线程 1: 0 libSystem.B.dylib
0x937b88da mach_msg_trap + 10 1
libSystem.B.dylib
0x937b9047 mach_msg + 68 2
核心基础
0x026bb022 CFRunLoopRunSpecific + 1954 3 核心基础
0x026ba878 CFRunLoopRunIn模式 + 88 4 网络核心
0x03151933 RunWebThread(无效*)+ 467 5 libSystem.B.dylib
0x937e5fbd _pthread_start + 345 6
libSystem.B.dylib
0x937e5e42 thread_start + 34

线程 0 在 X86 线程状态下崩溃 (32 位):eax:0x07802a50 ebx: 0x00017711 ecx: 0x9655d0c4 edx: 0x07833ba2 edi: 0x14600478 esi: 0x00000000 ebp: 0xbfffe158 esp: 0xbfffdfd4 ss: 0x0000001f efl: 0x00010206 eip: 0x9805aedb CS: 0x00000017 ds: 0x0000001f es: 0x0000001f FS: 0x00000000 GS: 0x00000037 cr2:0x14600478

二值图像: 0x1000 - 0x5ff7 +现金??? (???) /用户/knyck2/库/应用程序 支持/iPhone 模拟器/3.2/应用程序/F54FA00C-9E77-4B9A-8774-2D5B5488A1BA/Cash.app/Cash 0xd000 - 0xfff7 +PBGDBIntrospectionSupport.A.dylib ??? (???) <8C448816-8655-143E-DA39-C8157FDA8C8B> /Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib 0x14000 - 0x1a8ff3 +基金会??? (???) <4361202B-C361-85C9-AAD0-3D062EF44941> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Foundation 0x29e000 - 0x2063fe7 +UIKit ??? (???) <524597DC-F210-115D-E31D-01A3429E25C7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit 0x23be000 - 0x25c6fe7 com.apple.CoreGraphics 1.359.16 (???) <017CBE03-17D3-25FD-E775-087B415993AA> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics 0x262e000 - 0x2665ff7 +核心位置 ??? (???) <80CA49D0-A8EA-0638-A407-0CC131AEEB41> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreLocation.framework/CoreLocation 0x268e000 - 0x2799fff +CoreFoundation ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 0x287d000 - 0x2a15fe7 +libicucore.A.dylib ??? (???)<13A09086-26EF-E491-ADD8-9019C31542FC> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libicucore.A.dylib 0x2a76000 - 0x2b75fe7 +libxml2.2.dylib ??? (???)<78BEDCC4-E0FD-1C59-70ED-46FB3D76055C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libxml2.2.dylib 0x2b9a000 - 0x2c41fe7 +CFNetwork ??? (???) <24AFEAF9-230F-C79A-3A2F-BB9F1945CF9A> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CFNetwork.framework/CFNetwork 0x2cc0000 - 0x2cf4ff7 +系统配置??? (???)<5448E217-DB17-F241-AB84-C2FE18372948> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration 0x2d16000 - 0x2d65ff7 +安全??? (???) <90BF3878-B2F5-8FD0-4E81-B59E64C47E1D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Security.framework/Security 0x2d8b000 - 0x2e58fe7 +libsqlite3.dylib ??? (???)<3B663A82-D85F-3CD5-130C-FAA6C5ED2D0E> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libsqlite3.dylib 0x2e68000 - 0x2ef3fff com.apple.framework.IOKit 1.5.1 (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x2f19000 - 0x2f26ff3 +图形服务??? (???) <7FB2250F-CDD1-D975-0387-6E884CC061CD> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices 0x2f39000 - 0x3071ff7 +JavaScriptCore ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore 0x30c5000 - 0x3888fe7 +WebCore ??? (???) <8801B91D-C8BC-51CC-B80A-FB9C67BA8FF2> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore 0x3db5000 - 0x3e4bff7 +WebKit ??? (???) <0D579ECA-E22E-7C70-A214-73D2221CD1C7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/WebKit.framework/WebKit 0x3ec9000 - 0x3f87fe7 +ImageIO ??? (???) <524C2CFC-6F77-3B4F-390F-40711BB56980> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/ImageIO.framework/ImageIO 0x3fb2000 - 0x3fd0ff7 +地址簿 ??? (???) <2EF304E3-4B16-5B0E-E072-BFABF4B44CF5> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AddressBook.framework/AddressBook 0x3ff1000 - 0x4145fe7 +音频工具箱 ??? (???) <27DC788A-231B-9DB5-0B48-04A2A8D27F32> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox 0x4198000 - 0x425aff7 +QuartzCore ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore 0x42b5000 - 0x42c2ff7 +SpringBoard服务??? (???)<3CDBCAE3-B6D3-D734-6CB0-AB39EBBE7D57> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices 0x42cd000 - 0x42f9fff +应用程序支持??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport 0x4319000 - 0x435cfe7 +CoreText ??? (???) <971632EA-E809-8D15-BE25-E115A4FBDFF4> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreText.framework/CoreText 0x438c000 - 0x43c7ff7 +移动核心服务??? (???) <5BFA76AC-EC1B-8D9F-4533-B3DD44041107> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices 0x43e5000 - 0x448efe7 +校对器 ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/ProofReader.framework/ProofReader 0x44ab000 - 0x44b6ff7 +CoreVideo ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/CoreVideo.framework/CoreVideo 0x44c2000 - 0x44d8fe7 +OpenGLES ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES 0x44e2000 - 0x4558ff3 +CoreAudio ??? (???) <14C17E9E-0D13-A7BD-3A06-C3F460FD261C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreAudio.framework/CoreAudio 0x4594000 - 0x4649fe7 libcrypto.0.9.7.dylib ??? (???) <39CDB041-9DF5-01B1-4B33-03EC4CCA40B3> /usr/lib/libcrypto.0.9.7.dylib 0x468f000 - 0x46b5fff libssl.0.9.7.dylib ??? (???) <924E1BF8-C24D-4A5C-3DB6-A85034392D19> /usr/lib/libssl.0.9.7.dylib 0x46ea000 - 0x46eaff7 +AccessibilitySettingsLoader ??? (???)<21BFF58D-21D2-210F-3150-873A8CC87399> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/AccessibilityBundles/AccessibilitySettingsLoader.bundle/AccessibilitySettingsLoader 0x46ef000 - 0x46f1ff7 +libAccessibility.dylib ??? (???)<9F1CEAA6-2910-7F97-A626-DAA33724ED79> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libAccessibility.dylib 0x7900000 - 0x7909ffb +IAP ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/IAP.framework/IAP 0x7916000 - 0x794cff7 +UIKit ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/AccessibilityBundles/UIKit.axbundle/UIKit 0x7990000 - 0x799bff7 +用户界面辅助功能??? (???)<4E2BD72C-F67F-D0DF-78FA-FB1D5840F6B7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/UIAccessibility.framework/UIAccessibility 0x79ab000 - 0x79baff7 +AXRuntime ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/AXRuntime.framework/AXRuntime 0x79c8000 - 0x7a0afe7 +libCGFreetype.A.dylib ??? (???)<8853F0B7-8EE5-AD36-BC97-B0AD8782E547> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib 0x7f31000 - 0x7f57fe7 +libRIP.A.dylib ??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib 0x9cff000 - 0x9d3efe7 +文本输入??? (???) /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/TextInput.framework/TextInput 0x9d6a000 - 0x9eafff3 +libmecabra.dylib ??? (???)<1C45F15E-3F66-3F28-46C7-78EC4B63C803> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libmecabra.dylib 0x9ee1000 - 0x9ff4ff7 +核心数据??? (???) <6F49CC28-8102-D224-EBBD-12045B6DBA92> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreData.framework/CoreData 0x8fe00000 - 0x8fe4162b dyld 132.1 (???) <211AF0DD-42D9-79C8-BB6A-1F4BEEF4B4AB> /usr/lib/dyld 0x91fe7000 - 0x91feafe7 libmathCommon.A.dylib ??? (???) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib 0x93497000 - 0x93501fe7 libstdc++.6.dylib ??? (???) <411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib 0x937b8000 - 0x9395cfeb libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib 0x96692000 - 0x966d8ff7 libauto.dylib ??? (???)<85670A64-3B67-8162-D441-D8E0BE15CA94> /usr/lib/libauto.dylib 0x9706e000 - 0x97082fe7 libbsm.0.dylib ??? (???) <14CB053A-7C47-96DA-E415-0906BA1B78C9> /usr/lib/libbsm.0.dylib 0x98055000 - 0x98102fe7 libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib 0x98103000 - 0x981f7fe7 libiconv.2.dylib ??? (???) <0C578460-3929-29DD-585A-DB1E0C977425> /usr/lib/libiconv.2.dylib 0x98fd9000 - 0x98fe7fe7 libz.1.dylib ??? (???) <7B7A02AB-DA99-6180-880E-D28E4F9AA8EB> /usr/lib/libz.1.dylib 0xffff0000 - 0xffff1fff libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib

I am building this app and I am encountering some issues I haven't seen before.

  1. the app crashes when I run the method below which is connected to a UIButton for a trigger. so when I hit the button it does the print and then the simulator crashes to the springboard. if I launch the app again from the springboard it doesn't get to the print method, if I rebuild from Xcode it does, and then promptly crashes as before.

  2. Usually there is some info in the debug console where I can at least get a clue as to what is going on but there doesn't seem to be much there. One thing I noticed is that there is something about accessibility being turned on or something when the app initially launches in the simulator, I can't remember if that is always there or not:

2010-02-18 10:35:19.024 Cash[497:207]
******* Accessibility Status Changed: On 2010-02-18 10:35:19.134
Cash[497:207] ********** Loading AX
for: com.yourcompany.Cash ************

copyright 2010 Nicholas Iannone:

-(IBAction) logTransaction {

NSIndexPath *indexPath = [[NSIndexPath alloc] init];
indexPath = [self.categoryTableView indexPathForSelectedRow];

NSInteger selectedCategory = indexPath.row;
[indexPath release];
NSString *categoryString = [[NSString alloc] init];
categoryString = [self.categoryArray objectAtIndex:selectedCategory];
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 1000.0f;
[locationManager startUpdatingLocation];
double x = 10.0;
double y = 10.0;
NSString *descriptionString = [[NSString alloc] init];

descriptionString = descriptionField.text;
//[locationManager stopUpdatingLocation];

Transaction *newTransaction = [[Transaction alloc] initWithAmount:    [self.amountField.text integerValue] 
                                                      description: descriptionString 
                                                         category: categoryString   
                                                        locationX: x 
                                                        locationY: y];

                                      [categoryString release];
[newTransaction print];

 //log transaction here...

[newTransaction release];

here's the console output:

2/18/10 10:35:19
AM Cash[497] ********** Loading AX
for: com.yourcompany.Cash ************
2/18/10 10:35:28
AM Cash[497] 0.000000,sddssd,Snacks,2010-02-18
10:35:28 -0800,10.000000,10.000000
2/18/10 10:35:28
AM com.apple.launchd.peruser.501[91] (UIKitApplication:com.yourcompany.Cash[0x9148][497])
Job appears to have crashed:
Segmentation fault 2/18/10 10:35:28
AM SpringBoard[482] Application 'Cash'
exited abnormally with signal 11:
Segmentation fault 2/18/10 10:35:28
AM ReportCrash[491] Saved crash report
for Cash[497] version ??? (???) to
/Users/knyck2/Library/Logs/DiagnosticReports/Cash_2010-02-18-103528_Nicholas-Iannones-MacBook-Pro.crash

here's the crash log:

Process: Cash [497] Path:
/Users/knyck2/Library/Application
Support/iPhone
Simulator/3.2/Applications/F54FA00C-9E77-4B9A-8774-2D5B5488A1BA/Cash.app/Cash
Identifier: Cash Version:
??? (???) Code Type: X86
(Native) Parent Process: launchd [91]

Date/Time: 2010-02-18
10:35:28.631 -0800 OS Version:
Mac OS X 10.6.2 (10C540) Report
Version: 6

Exception Type: EXC_BAD_ACCESS
(SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at
0x0000000014600478 Crashed Thread: 0
Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: release
iPhone Simulator 3.2 (193), iPhone OS
3.2 (7B298g)

Thread 0 Crashed: Dispatch queue:
com.apple.main-thread 0
libobjc.A.dylib
0x9805aedb objc_msgSend + 27 1
UIKit
0x002b4a19 _UIApplicationHandleEvent
+ 8468 2 GraphicsServices 0x02f1f2a8 PurpleEventCallback + 1576
3 CoreFoundation
0x026bb87e CFRunLoopRunSpecific +
4094 4 CoreFoundation
0x026ba878 CFRunLoopRunInMode + 88 5
GraphicsServices
0x02f1da4d GSEventRunModal + 217 6
GraphicsServices
0x02f1db12 GSEventRun + 115 7 UIKit
0x002b265d UIApplicationMain + 1134 8
Cash
0x00002648 main + 102 (main.m:13) 9
Cash
0x000025b6 start + 54

Thread 1: 0 libSystem.B.dylib
0x937b88da mach_msg_trap + 10 1
libSystem.B.dylib
0x937b9047 mach_msg + 68 2
CoreFoundation
0x026bb022 CFRunLoopRunSpecific +
1954 3 CoreFoundation
0x026ba878 CFRunLoopRunInMode + 88 4
WebCore
0x03151933 RunWebThread(void*) + 467
5 libSystem.B.dylib
0x937e5fbd _pthread_start + 345 6
libSystem.B.dylib
0x937e5e42 thread_start + 34

Thread 0 crashed with X86 Thread State
(32-bit): eax: 0x07802a50 ebx:
0x00017711 ecx: 0x9655d0c4 edx:
0x07833ba2 edi: 0x14600478 esi:
0x00000000 ebp: 0xbfffe158 esp:
0xbfffdfd4 ss: 0x0000001f efl:
0x00010206 eip: 0x9805aedb cs:
0x00000017 ds: 0x0000001f es:
0x0000001f fs: 0x00000000 gs:
0x00000037 cr2: 0x14600478

Binary Images:
0x1000 - 0x5ff7 +Cash ??? (???)

/Users/knyck2/Library/Application
Support/iPhone
Simulator/3.2/Applications/F54FA00C-9E77-4B9A-8774-2D5B5488A1BA/Cash.app/Cash
0xd000 - 0xfff7 +PBGDBIntrospectionSupport.A.dylib ??? (???)
<8C448816-8655-143E-DA39-C8157FDA8C8B>
/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib
0x14000 - 0x1a8ff3 +Foundation ???
(???)
<4361202B-C361-85C9-AAD0-3D062EF44941>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Foundation
0x29e000 - 0x2063fe7 +UIKit ??? (???)
<524597DC-F210-115D-E31D-01A3429E25C7>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit
0x23be000 - 0x25c6fe7
com.apple.CoreGraphics 1.359.16 (???)
<017CBE03-17D3-25FD-E775-087B415993AA>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x262e000 - 0x2665ff7 +CoreLocation
??? (???)
<80CA49D0-A8EA-0638-A407-0CC131AEEB41>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x268e000 - 0x2799fff +CoreFoundation
??? (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x287d000 - 0x2a15fe7
+libicucore.A.dylib ??? (???) <13A09086-26EF-E491-ADD8-9019C31542FC>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libicucore.A.dylib
0x2a76000 - 0x2b75fe7
+libxml2.2.dylib ??? (???) <78BEDCC4-E0FD-1C59-70ED-46FB3D76055C>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libxml2.2.dylib
0x2b9a000 - 0x2c41fe7 +CFNetwork ???
(???)
<24AFEAF9-230F-C79A-3A2F-BB9F1945CF9A>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x2cc0000 - 0x2cf4ff7
+SystemConfiguration ??? (???) <5448E217-DB17-F241-AB84-C2FE18372948>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x2d16000 - 0x2d65ff7 +Security ???
(???)
<90BF3878-B2F5-8FD0-4E81-B59E64C47E1D>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Security.framework/Security
0x2d8b000 - 0x2e58fe7
+libsqlite3.dylib ??? (???) <3B663A82-D85F-3CD5-130C-FAA6C5ED2D0E>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libsqlite3.dylib
0x2e68000 - 0x2ef3fff
com.apple.framework.IOKit 1.5.1 (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x2f19000 - 0x2f26ff3
+GraphicsServices ??? (???) <7FB2250F-CDD1-D975-0387-6E884CC061CD>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x2f39000 - 0x3071ff7 +JavaScriptCore
??? (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x30c5000 - 0x3888fe7 +WebCore ???
(???)
<8801B91D-C8BC-51CC-B80A-FB9C67BA8FF2>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x3db5000 - 0x3e4bff7 +WebKit ???
(???)
<0D579ECA-E22E-7C70-A214-73D2221CD1C7>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x3ec9000 - 0x3f87fe7 +ImageIO ???
(???)
<524C2CFC-6F77-3B4F-390F-40711BB56980>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/ImageIO.framework/ImageIO
0x3fb2000 - 0x3fd0ff7 +AddressBook
??? (???)
<2EF304E3-4B16-5B0E-E072-BFABF4B44CF5>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AddressBook.framework/AddressBook
0x3ff1000 - 0x4145fe7 +AudioToolbox
??? (???)
<27DC788A-231B-9DB5-0B48-04A2A8D27F32>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x4198000 - 0x425aff7 +QuartzCore ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x42b5000 - 0x42c2ff7
+SpringBoardServices ??? (???) <3CDBCAE3-B6D3-D734-6CB0-AB39EBBE7D57>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x42cd000 - 0x42f9fff +AppSupport ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x4319000 - 0x435cfe7 +CoreText ???
(???)
<971632EA-E809-8D15-BE25-E115A4FBDFF4>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreText.framework/CoreText
0x438c000 - 0x43c7ff7
+MobileCoreServices ??? (???) <5BFA76AC-EC1B-8D9F-4533-B3DD44041107>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x43e5000 - 0x448efe7 +ProofReader
??? (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x44ab000 - 0x44b6ff7 +CoreVideo ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/CoreVideo.framework/CoreVideo
0x44c2000 - 0x44d8fe7 +OpenGLES ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x44e2000 - 0x4558ff3 +CoreAudio ???
(???)
<14C17E9E-0D13-A7BD-3A06-C3F460FD261C>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x4594000 - 0x4649fe7
libcrypto.0.9.7.dylib ??? (???)
<39CDB041-9DF5-01B1-4B33-03EC4CCA40B3>
/usr/lib/libcrypto.0.9.7.dylib
0x468f000 - 0x46b5fff
libssl.0.9.7.dylib ??? (???)
<924E1BF8-C24D-4A5C-3DB6-A85034392D19>
/usr/lib/libssl.0.9.7.dylib 0x46ea000
- 0x46eaff7 +AccessibilitySettingsLoader ??? (???) <21BFF58D-21D2-210F-3150-873A8CC87399>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/AccessibilityBundles/AccessibilitySettingsLoader.bundle/AccessibilitySettingsLoader
0x46ef000 - 0x46f1ff7
+libAccessibility.dylib ??? (???) <9F1CEAA6-2910-7F97-A626-DAA33724ED79>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libAccessibility.dylib 0x7900000 - 0x7909ffb +IAP ??? (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/IAP.framework/IAP
0x7916000 - 0x794cff7 +UIKit ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/AccessibilityBundles/UIKit.axbundle/UIKit
0x7990000 - 0x799bff7
+UIAccessibility ??? (???) <4E2BD72C-F67F-D0DF-78FA-FB1D5840F6B7>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/UIAccessibility.framework/UIAccessibility
0x79ab000 - 0x79baff7 +AXRuntime ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/AXRuntime.framework/AXRuntime
0x79c8000 - 0x7a0afe7
+libCGFreetype.A.dylib ??? (???) <8853F0B7-8EE5-AD36-BC97-B0AD8782E547>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x7f31000 - 0x7f57fe7 +libRIP.A.dylib
??? (???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x9cff000 - 0x9d3efe7 +TextInput ???
(???)

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/PrivateFrameworks/TextInput.framework/TextInput
0x9d6a000 - 0x9eafff3
+libmecabra.dylib ??? (???) <1C45F15E-3F66-3F28-46C7-78EC4B63C803>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/usr/lib/libmecabra.dylib
0x9ee1000 - 0x9ff4ff7 +CoreData ???
(???)
<6F49CC28-8102-D224-EBBD-12045B6DBA92>
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreData.framework/CoreData
0x8fe00000 - 0x8fe4162b dyld 132.1
(???)
<211AF0DD-42D9-79C8-BB6A-1F4BEEF4B4AB>
/usr/lib/dyld 0x91fe7000 - 0x91feafe7
libmathCommon.A.dylib ??? (???)
<1622A54F-1A98-2CBE-B6A4-2122981A500E>
/usr/lib/system/libmathCommon.A.dylib
0x93497000 - 0x93501fe7
libstdc++.6.dylib ??? (???)
<411D87F4-B7E1-44EB-F201-F8B4F9227213>
/usr/lib/libstdc++.6.dylib 0x937b8000
- 0x9395cfeb libSystem.B.dylib ??? (???)

/usr/lib/libSystem.B.dylib 0x96692000
- 0x966d8ff7 libauto.dylib ??? (???) <85670A64-3B67-8162-D441-D8E0BE15CA94>
/usr/lib/libauto.dylib 0x9706e000 -
0x97082fe7 libbsm.0.dylib ??? (???)
<14CB053A-7C47-96DA-E415-0906BA1B78C9>
/usr/lib/libbsm.0.dylib 0x98055000 -
0x98102fe7 libobjc.A.dylib ??? (???)

/usr/lib/libobjc.A.dylib 0x98103000 -
0x981f7fe7 libiconv.2.dylib ??? (???)
<0C578460-3929-29DD-585A-DB1E0C977425>
/usr/lib/libiconv.2.dylib 0x98fd9000 -
0x98fe7fe7 libz.1.dylib ??? (???)
<7B7A02AB-DA99-6180-880E-D28E4F9AA8EB>
/usr/lib/libz.1.dylib 0xffff0000 -
0xffff1fff libSystem.B.dylib ???
(???)

/usr/lib/libSystem.B.dylib

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

_蜘蛛 2024-08-28 16:36:54

这是错误的:

NSIndexPath *indexPath = [[NSIndexPath alloc] init];
indexPath = [self.categoryTableView indexPathForSelectedRow];

NSInteger selectedCategory = indexPath.row;
[indexPath release];

您正在实例化一个空的 NSIndexPath,然后覆盖对它的引用。最后一行的释放被发送到表视图返回的完全不同的对象。您创建的对象永远不会被使用,也永远不会被释放。

这将起作用:

NSIndexPath *indexPath = [self.categoryTableView indexPathForSelectedRow];
NSInteger selectedCategory = indexPath.row;

您没有创建 NSIndexPath 对象,因此您没有责任释放它。

(不必要的释放导致索引路径实例过早释放。当Apple的代码尝试释放该对象时,它不再存在,并且应用程序崩溃)

This is wrong:

NSIndexPath *indexPath = [[NSIndexPath alloc] init];
indexPath = [self.categoryTableView indexPathForSelectedRow];

NSInteger selectedCategory = indexPath.row;
[indexPath release];

You're instantiating an empty NSIndexPath and then overwriting the reference to it. The release on the last line is sent to an entirely different object returned by the table view. The object you create is never used and never released.

This will work:

NSIndexPath *indexPath = [self.categoryTableView indexPathForSelectedRow];
NSInteger selectedCategory = indexPath.row;

You're not creating an NSIndexPath object, so you have no responsibility to release it.

(your unnecessary release is causing the index path instance to be prematurely deallocated. When Apple's code tries to release the object, it no longer exists, and the app crashes)

日记撕了你也走了 2024-08-28 16:36:54

这只是一个猜测,因为并非所有代码都在那里。在 Transaction 类的 init 方法中,您是否确保保留字符串? (类别和描述)。

对我来说最突出的是初始化事务,然后立即释放categoryString。如果您不保留该字符串,那么这可能是崩溃的根源。

顺便说一句,你正在泄漏内存。这里:

NSString *descriptionString = [[NSString alloc] init];
descriptionString = descriptionField.text;

descriptionString指向一个新分配的字符串,只是被重新分配给一个现有的字符串,因此第一个字符串被泄漏。您应该将其更改为:

NSString *descriptionString;
descriptionString = descriptionField.text;

或更简单:

NSString *descriptionString = descriptionField.text;

This is just a guess, as not all of the code is there. In your init method for the Transaction class, do you make sure to retain the strings? (category and description).

The thing that stands out to me is that you initialize the Transaction, then release the categoryString immediately after. If you're not retaining the string, then this could be the source of your crash.

On a side note, you are leaking memory. Here:

NSString *descriptionString = [[NSString alloc] init];
descriptionString = descriptionField.text;

descriptionString is pointing to a newly allocating string, only to be reassigned to an existing string, so the first string is leaked. You should change this to:

NSString *descriptionString;
descriptionString = descriptionField.text;

or more simply:

NSString *descriptionString = descriptionField.text;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文