Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8374683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:58:34+00:00 2026-06-09T14:58:34+00:00

I discovered weird behavior of Xcode. Xcode debugger doesn’t break for uncaught exception in

  • 0

I discovered weird behavior of Xcode.
Xcode debugger doesn’t break for uncaught exception in this code.

@try            { @throw @"AA"; }
@catch (...)    { @throw;       }
@finally        { return;       }

But exception in this code caught and trigger Xcode break execution for debugging.

@try            { @throw @"AA"; }
@catch (...)    { @throw;       }
@finally        {               }

If @finally block returns debugger can’t catch the exception. Have you ever seen this problem? I’m not sure this is really an issue. By the perspective it looks like designed behavior. I don’t know why. Shouldn’t I return in @finally block? My problem is it swallows exception silently, so I can’t detect it.

Shame on me, I don’t know well try…catch…finally behaviors. I almost haven’t used exception catching code. Is this designed behavior or buggy behavior? Is this any known issue?

Here’s my environment.

  • Xcode Version 4.4 (4F250)
  • OS X 10.7.4

Edit

I attach full test source code.

#import <Foundation/Foundation.h>

int main (int a, char** b)
{
    @try
    {
        NSLog(@"trying something...");

        @try            { @throw @"AA"; }
        @catch (...)    { @throw;       }
        @finally        { return 0;     }
    }
    @catch (...)
    {
        NSLog(@"something catched.");
    }
    @finally
    {
        NSLog(@"finally...");
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:58:36+00:00Added an answer on June 9, 2026 at 2:58 pm

    Putting a return in a @finally block seems like a bad idea. The exception handling mechanism is going to try to unwind the call stack as it deals with the exception you’re throwing. If a @finally block changes what’s on the stack, you undermine the exception handler. It doesn’t seem at all surprising that this crashes.

    Also, as bbum pointed out, exceptions aren’t used for flow control in Cocoa and Cocoa Touch. Throwing an exception through a Cocoa method usually fails. Even if what you’re doing is supposed to work in generic Objective-C, it would probably still cause problems in real code.

    Short answer: Don’t do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I discovered this weird bug, it's so odd and I can't understand why
I'm trying to build a php function and discovered some weird behavior and I
Live site. After testing a site I'm working on, I've discovered a weird break
I discovered this quite by accident while looking for a file with a number
I just had some weird behavior from a version of g++ for Windows that
I have run into a rather weird little problem. In the following code I
Today, I discovered that using Collections.synchronizedXXX doesn't play well with reflection. Here's a simple
Jackson is throwing a weird exception that I don't know how to fix. I'm
Ok, this is a really weird one. I'm sending Latitude/Longitude to Emulator running my
I encountered a weird behavior of Cocoa Touch / iOS involving static method. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.