程序运行崩溃 SIGABRT __NSDictionaryI rangeOfCharacterFromSet:]

本文解析了一个TableView在代理方法中因属性赋值不当导致的程序崩溃问题。详细介绍了从SIGABRT错误到最终修复的过程,强调了类型检查的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


转至元数据结尾
转至元数据起始

最后报错 [__NSDictionaryI rangeOfCharacterFromSet:] 定位不到具体的代码

最后发现是 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath


NSString *devName = [dic objectForKey:@"DevName"];

错误

cell.lbTitle.text = [devName isEqualToString:@""] ? [dic objectForKey:@"SN"] : dic;

正确

cell.lbTitle.text = [devName isEqualToString:@""] ? [dic objectForKey:@"SN"] : devName;

 

代理方法中 某一个属性的text 传成了NSDictionary类型 。 Tableview没有立马报错 而是所有方法运行结束后 崩溃 不好定位

F DEBUG : Revision: '0' 06-17 13:02:50.866 3387 3387 F DEBUG : ABI: 'arm64' 06-17 13:02:50.866 3387 3387 F DEBUG : Timestamp: 2025-06-17 13:02:50.819939240+0800 06-17 13:02:50.866 3387 3387 F DEBUG : Process uptime: 0s 06-17 13:02:50.866 3387 3387 F DEBUG : Cmdline: zygote64 06-17 13:02:50.866 3387 3387 F DEBUG : pid: 3343, tid: 3343, name: zygote64 >>> zygote64 <<< 06-17 13:02:50.866 3387 3387 F DEBUG : uid: 0 06-17 13:02:50.866 3387 3387 F DEBUG : tagged_addr_ctrl: 0000000000000001 06-17 13:02:50.866 3387 3387 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 06-17 13:02:50.866 3387 3387 F DEBUG : Abort message: 'Check failed: region_space_mem_map.IsValid() No region space mem map' 06-17 13:02:50.866 3387 3387 F DEBUG : x0 0000000000000000 x1 0000000000000d0f x2 0000000000000006 x3 0000007fee5ec270 06-17 13:02:50.866 3387 3387 F DEBUG : x4 626f1f2f2f221f39 x5 626f1f2f2f221f39 x6 626f1f2f2f221f39 x7 7f7f7f7f7f7f7f7f 06-17 13:02:50.866 3387 3387 F DEBUG : x8 00000000000000f0 x9 184016312c74b107 x10 0000000000000000 x11 ffffff80ffffffdf 06-17 13:02:50.866 3387 3387 F DEBUG : x12 0000000000000001 x13 0000000000000001 x14 0000007fee5eb080 x15 00000019dae90ddd 06-17 13:02:50.866 3387 3387 F DEBUG : x16 000000701747c050 x17 0000007017458db0 x18 0000007023172000 x19 0000000000000d0f 06-17 13:02:50.866 3387 3387 F DEBUG : x20 0000000000000d0f x21 00000000ffffffff x22 0000007022323000 x23 000000000000000c 06-17 13:02:50.866 3387 3387 F DEBUG : x24 b400006e682d8650 x25 b400006db82df150 x26 0000007021e7f14c x27 0000006d77817000 06-17 13:02:50.866 3387 3387 F DEBUG : x28 0000006d77818000 x29 0000007fee5ec2f0 06-17 13:02:50.866 3387 3387 F DEBUG : lr 000000701740baa0 sp 0000007fee5ec250 pc 000000701740bacc pst 0000000000001000 06-17 13:02:50.866 3387 3387 F DEBUG : backtrace: 06-17 13:02:50.866 3387 3387 F DEBUG : #00 pc 000000000004facc /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: cd7952cb40d1a2deca6420c2da7910be) 06-17 13:02:50.866 3387 3387 F DEBUG : #01 pc 00000000006267b4 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+704) (BuildId: 4925dbfec35f1037f8ee5dab9b73e87d) 06-17 13:02:50.866 3387 3387 F DEBUG : #02 pc 000000000001595c /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76) (BuildId: 2614b5e8c844b2fa09ddee50c74561f8) 06-17 13:02:50.866 3387 3387 F DEBUG : #03 pc 0000000000014f8c /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+364) (BuildId: 2614b5e8c844b2fa09ddee50c74561f8) 06-17 13:02:50.866 3387 3387 F DEBUG : #04 pc 0000000000365044 /apex/com.android.art/lib64/libart.so (art::gc::Heap::Heap(unsigned long, unsigned long, unsigned long, unsigned long, double, double, unsigned long, unsigned long, unsigned long, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, art::InstructionSet, art::gc::CollectorType, art::gc::CollectorType, art::gc::space::LargeObjectSpaceType, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned long, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, unsigned long, bool, bool)+9456) (BuildId: 4925dbfec35f1037f8ee5dab9b73e87d) 06-17 13:02:50.866 3387 3387 F DEBUG : #05 pc 000000000062b0cc /apex/com.android.art/lib64/libart.so (art::Runtime::Init(art::RuntimeArgumentMap&&)+14108) (BuildId: 4925dbfec35f1037f8ee5dab9b73e87d) 06-17 13:02:50.866 3387 3387 F DEBUG : #06 pc 000000000062eb20 /apex/com.android.art/lib64/libart.so (art::Runtime::Create(std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void const*>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void const*> > > const&, bool)+128) (BuildId: 4925dbfec35f1037f8ee5dab9b73e87d) 06-17 13:02:50.866 3387 3387 F DEBUG : #07 pc 0000000000456928 /apex/com.android.art/lib64/libart.so (JNI_CreateJavaVM+696) (BuildId: 4925dbfec35f1037f8ee5dab9b73e87d) 06-17 13:02:50.866 3387 3387 F DEBUG : #08 pc 00000000001dba0c /system/lib64/libandroid_runtime.so (JNI_CreateJavaVM+68) (BuildId: 642889169def4fdc2be33cda134f26ee) 06-17 13:02:50.866 3387 3387 F DEBUG : #09 pc 00000000000c0814 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::startVm(_JavaVM**, _JNIEnv**, bool, bool)+9708) (BuildId: 642889169def4fdc2be33cda134f26ee) 06-17 13:02:50.866 3387 3387 F DEBUG : #10 pc 00000000000c0e38 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+456) (BuildId: 642889169def4fdc2be33cda134f26ee) 06-17 13:02:50.866 3387 3387 F DEBUG : #11 pc 000000000000258c /system/bin/app_process64 (main+1336) (BuildId: c1694cb88d614eeb462c75478acba9bd) 06-17 13:02:50.866 3387 3387 F DEBUG : #12 pc 00000000000487dc /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96) (BuildId: cd7952cb40d1a2deca6420c2da7910be) 06-17 13:02:50.873 3387 3387 E crash_dump64: unable to connect to activity manager: Connection refused 06-17 13:02:50.873 398 398 E tombstoned: Tombstone written to: tombstone_15
06-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值