2

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.

Volker
  • 4,640
  • 1
  • 23
  • 31
  • 1
    Post the full error message of the crash, and show which line is being tagged as the crash line. You may need to add a symbolic breakpoint for all exceptions from Objective-C and re-run your program. That sometimes causes the debugger to tell you the line number that is actually crashing rather than pointing to main (which really means that it can't tell you which line crashed.) – Duncan C Jan 09 '15 at 00:38
  • @DuncanC Thank you. But where can I find the full error message, if I may ask ? – Enock Nshuti Jan 09 '15 at 07:23

1 Answers1

0

You can let Xcode to location the crash point:

Select "Create Exception Breakpoint" in Xcode menu "Debug/Breakpoints", then hit run, Xcode will stop at the line which cause the app to crash.

also check this: Exception Breakpoint in Xcode

Hope this will help!

Community
  • 1
  • 1