In my project, i have imported some third party frameworks like google-maps. EveryThing work fine when compiling, but when it runs, the app crashes and i could track the suspicious method:
//Invoked when the class is instantiated in XIB
-(id)initWithCoder:(NSCoder*)aDecoder
{
self = [super initWithCoder:aDecoder];
if(self)
{
[self customInitialization];
}
return self;
}
Here is the stack of the crash i got:
TestMapDirections[1343:11603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(0x13ea052 0x2035d0a 0x1392a78 0x13929e9 0xae854b 0xae84d5 0x23e3f 0x23d17 0x223b0 0x2230b 0x29e5 0x2ae6 0x3d3335 0x4d1fa2 0x4d16b7 0x3d2ead 0x4d1fa2 0x4d19af 0x4d16b7 0x3d2305 0x5d884f 0x5d8dd7 0x13ebec9 0x1b75c2 0x1b755a 0x25cb76 0x25d03f 0x25c2fe 0x1dca30 0x1dcc56 0x1c3384 0x1b6aa9 0x1601fa9 0x13be1c5 0x1323022 0x132190a 0x1320db4 0x1320ccb 0x1600879 0x160093e 0x1b4a9b 0x2478 0x23d5)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
You can download my application and try it on your stuff, maybe you can help me more figure out the problem, thanx in advance.
EDIT:
@JSON coco: here is the code of the customInitialization method:
-(void)customInitialization
{
// do the initialization of class variables here..
mDirections = [UICGDirections sharedDirections];
mDirections.delegate = self;
}
-customInitializationmethod?-initWithCoder:method and find the one that is unpacking the URL from the coder and trying to initialize an ivar. Change that so you check that the URL you decoded was not nil before you attempt to call that method.UIViewControllerclass, it's a view controller, please if you don't mind, download my sample and tell me which class should i fix in it the-initWithCoderissues and make your suggestion as an answer :)