gpt4 book ai didi

ios - 选择索引处的对象时执行EXC BAD指令

转载 作者:行者123 更新时间:2023-12-01 16:36:24 25 4
gpt4 key购买 nike

当选择索引处的对象时,我得到EXC BAD INSTRUCTION。我真的找不到这个问题的任何重复之处。请帮我诊断一下。

崩溃降落在这里/主线程:

int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}

这是线程2:
libsystem_kernel.dylib`kevent64:
0x10e486224: movl $0x2000171, %eax
0x10e486229: movq %rcx, %r10
0x10e48622c: syscall
0x10e48622e: jae 0x10e486238 ; kevent64 + 20
0x10e486230: movq %rax, %rdi
0x10e486233: jmp 0x10e480ca3 ; cerror_nocancel
0x10e486238: retq
0x10e486239: nop
0x10e48623a: nop
0x10e48623b: nop

这也是:
libdispatch.dylib`_dispatch_mgr_thread:
0x10e121f9f: pushq %rbp
0x10e121fa0: movq %rsp, %rbp
0x10e121fa3: subq $0x800, %rsp
0x10e121faa: callq 0x10e121fd5 ; _dispatch_mgr_init
0x10e121faf: callq 0x10e1345c0 ; symbol stub for: pthread_self
0x10e121fb4: movq %rax, %rdi
0x10e121fb7: callq 0x10e1345a2 ; symbol stub for: pthread_get_stackaddr_np
0x10e121fbc: leaq -0x7f8(%rbp), %rdi
0x10e121fc3: subq %rdi, %rax
0x10e121fc6: xorl %esi, %esi
0x10e121fc8: movq %rax, %rdx
0x10e121fcb: callq 0x10e1343a4 ; symbol stub for: memset
0x10e121fd0: callq 0x10e122139 ; _dispatch_mgr_invoke

这是有问题的方法:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSURL *selectedSermon = [[NSURL alloc]initWithString:[[sermons objectAtIndex:indexPath.row]urlForAudioSermon]];
AVAsset *asset = [AVURLAsset URLAssetWithURL:selectedSermon options:nil];
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:asset];

player = [AVPlayer playerWithPlayerItem:playerItem];

[player play];

}

请。如果您需要我提供更多信息,请告诉我。

最佳答案

您可以让Xcode定位崩溃点:

在Xcode菜单“Debug / Breakpoints”中选择“Create Exception Breakpoint”,然后单击运行,Xcode将在导致应用程序崩溃的行停止。

还要检查一下:
Exception Breakpoint in Xcode

希望这会有所帮助!

关于ios - 选择索引处的对象时执行EXC BAD指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27850688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com