I'm getting EXC BAD INSTRUCTION when object at index is selected. I can't really spot any duplicates of this question. Please help me diagnose this.
Crash landed here/ Main Thread:
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
This is Thread 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
and this too:
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
This is the method at question:
- (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];
}
Please. If there's any more info you need me to provide, just let me know.