当选择索引处的对象时,我得到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];
}
请。如果您需要我提供更多信息,请告诉我。
答案 0 :(得分:0)
您可以让Xcode定位崩溃点:
在Xcode菜单“Debug / Breakpoints”中选择“Create Exception Breakpoint”,然后点击run,Xcode将停在导致应用程序崩溃的行。
还检查一下: this answer
希望这会有所帮助!