App-wide exception handling

Discussion in 'iOS Programming' started by moonman239, Aug 2, 2014.

  1. moonman239, Aug 2, 2014
    Last edited: Aug 2, 2014

    moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #1
    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.
     
  2. JohnsonK macrumors regular

    Joined:
    Mar 6, 2014
    #2
    Look into try/catch blocks

    ps: Wouldn't a simple if statement solve your issue?
     
  3. 1458279 Suspended

    1458279

    Joined:
    May 1, 2010
    Location:
    California
    #3
    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.
     

Share This Page