code crashes when adding view
I copied all my iphone viewcontroller files into an a new iPad project. (I changed the sizes of each nib files etc.)
Almost allviewControllers
are working except for one viewcontroller
say xview
.
At the line [self.view add:xview.view]
the code crashes with the following log
2011-06-22 14:08:56.435 RelaxInAMinutePad[5073:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
2011-06-22 14:08:56.437 RelaxInAMinutePad[5073:207] Stack: (
47421520,
48579372,
47159051,
47158890,
1569479,
1563144,
19971,
20321,
19638,
23235,
4095877,
30247,
5636593,
3472622,
3970110,
3979456,
3970037,
3472622,
3970110,
3979456,
3974253,
3599848,
3491395,
3523032,
56开发者_运维百科414588,
46700700,
46696616,
56408221,
56408418,
3515250,
8984,
8838
)
terminate called after throwing an instance of 'NSException'
I am not using any URL or anything from my code.
I am not getting why this is caused. I am sure this is not about coding but some thing to do with resources or IB.what may be the mistake and how to rectify?
Read the console:
reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
Somewhere you are trying to instantiate an NSURL
object, but the string you pass into it is nil
.
check your line
[self.view add xview.view]
it should be
[self.view addSubview xview.view]
Maybe you not add Nib-file in new project, or any other resource files...
精彩评论