Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
Hi,

I am developing an app. The code is finished; all I need to do is add some more data, which will be located in an XML file, and I'll be done. I expect the app to throw an exception; it does that when it is told to load a certain resource that it cannot find. The exception is not fatal, therefore I don't want to resolve the exception until the app is otherwise finished.

Edit: I found a way to tell the app how to handle uncaught exceptions. The way to do that is described in this post on Stack Overflow.

Edit #2: This is not the solution I am looking for. I don't want the app to terminate.
 
Last edited:
Look into try/catch blocks

ps: Wouldn't a simple if statement solve your issue?
 
I don't know if this will work with your app, but can you check if a resource is there before you run it?

There's things like doesrespondto kind of things that might be able to check a resource.

I think this was discussed in the topic of blocks.

Otherwise, the try/throw should work. You can run some test to see how much it slows things down to see which way to go.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.