NSInvalidArgumentException on NSURL before the app delegate

1

After an update on xcode 4.4.1, my app doesn't pass the compilation process anymore. This exception is thrown :

2012-09-11 14:32:19.057 MyApp[5001:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(0x356d888f 0x37a7f259 0x356d8789 0x356d87ab 0x3516905f 0x35168ffb 0x4005 0x33144cab 0x3313e7dd 0x3310cac3 0x3310c567 0x3310bf3b 0x372cb22b 0x356ac523 0x356ac4c5 0x356ab313 0x3562e4a5 0x3562e36d 0x3313d86b 0x3313acd5 0x3d0d 0x3c70)
terminate called throwing an exception(lldb) bt
* thread #1: tid = 0x1c03, 0x35f8e32c libsystem_kernel.dylib`__pthread_kill + 8, stop reason = signal SIGABRT
    frame #0: 0x35f8e32c libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x32ada20e libsystem_c.dylib`pthread_kill + 54
    frame #2: 0x32ad329e libsystem_c.dylib`abort + 94
    frame #3: 0x35a90f6a libc++abi.dylib`abort_message + 46
    frame #4: 0x35a8e34c libc++abi.dylib`_ZL17default_terminatev + 24
    frame #5: 0x37a7f356 libobjc.A.dylib`_objc_terminate + 146
    frame #6: 0x35a8e3c4 libc++abi.dylib`_ZL19safe_handler_callerPFvvE + 76
    frame #7: 0x35a8e450 libc++abi.dylib`std::terminate() + 20
    frame #8: 0x35a8f824 libc++abi.dylib`__cxa_rethrow + 88
    frame #9: 0x37a7f2a8 libobjc.A.dylib`objc_exception_rethrow + 12
    frame #10: 0x3562e50c CoreFoundation`CFRunLoopRunSpecific + 404
    frame #11: 0x3562e36c CoreFoundation`CFRunLoopRunInMode + 104
    frame #12: 0x3313d86a UIKit`-[UIApplication _run] + 550
    frame #13: 0x3313acd4 UIKit`UIApplicationMain + 1080
    frame #14: 0x00003d0c MyApp`main + 152 at main.m:23

Here I don't get the trick, because the exception is thrown before the app delegate is reached. So I really don't see where I missed an url ...

If someone can help, that would be really cool ... thanks :)

ios
crash
nsurl
launch
asked on Stack Overflow Sep 11, 2012 by choomz

2 Answers

0

There are two cases for exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter' :

1) Passing stringPath value to initFileURLWithPath:stringPath but it is nil

2) initFileURLWithPath:stringPath excepts stringPath to be NSString nothing else.

answered on Stack Overflow Sep 11, 2012 by Paresh Navadiya
0

Ok .. so the trick was a bad path on a .caf file that I imported ...

That was strange because it didn't show me the right line. Reimported the file corrected the bug.

To find the line, I used an exception breakpoints in the xcode breakpoint view ...

Thanks to the guy who showed me that :)

answered on Stack Overflow Sep 11, 2012 by choomz

User contributions licensed under CC BY-SA 3.0