0

I keep getting this type of error and the app gets crashed. Can anyone help me understand what this is exactly and how to understand what's the exact error. Help would be really appreciated.

Advancial[39482:1348062] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<QuickLookViewController 0x7f8eebdd37c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key main.'

Is there any way like it indicates the line number where it is throwing the error, like in java?, i want to get my head into how to solve this issue if faced again in future. Thanks

hynekcer
  • 14,942
  • 6
  • 61
  • 99
Sashi
  • 533
  • 3
  • 6
  • 21
  • When you get an error like the one above, it will spit out its stack trace to the console. You can also add a breakpoint (in your Xcode breakpoints panel) for "All Exceptions". – Ian MacDonald Nov 05 '14 at 19:31

1 Answers1

0

You have the call stack in Xcode. You can also set a breakpoint that will break on all exceptions, all C++ exceptions, or all Objective-C exceptions so your app stops at the point where the exception is thrown.

Note that unlike Java, exceptions in Objective-C usually indicate programming errors. So you would never try to catch the exception, but find out what bug caused the exception, and fix your code.

gnasher729
  • 51,477
  • 5
  • 75
  • 98