• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Objective-C++ now crashes (was "Objective-C exception handler blocks skipped")
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Objective-C++ now crashes (was "Objective-C exception handler blocks skipped")


  • Subject: Objective-C++ now crashes (was "Objective-C exception handler blocks skipped")
  • From: email@hidden
  • Date: Tue, 23 Jan 2007 21:11:09 +0000 (GMT)

OK, so I tried making up some test code to show the odd behavior when using the Objective-C++ compiler. However, when I compile my test code, I now get a crash. Filed Radar bug #4948857.
However, it would be great to get some idea if the Objective-C++ compiler is known to have problems and if there are any work-arounds, what you shouldn't do etc. It would be great if this could be looked at too.

Below is the code I compiled, for those that are interested. I used both a default Cocoa Application template and Carbon C++ Application template as the starting point. I then changed the following two project settings:
- "Compile Sources As" = Objective-C++
- "Enable Objective-C Exceptions" = checked

I get a crash on both a Core Duo iMac and a G5 iMac. Xcode 2.4.1.

Again, what can I expect from this compiler? Are there known issues that I should be aware of?

Very much looking for some info on this.

Doug Hill
Oracle Corp.
email@hidden


//-------------------------------------------------------------------------------

/*
* objcdispatch.h
*
* Created by Doug Hill on 1/23/07.
* Copyright 2007 Oracle Corp. All rights reserved.
*
*/

// ***************************************************************************************

#include <iostream>

#include <Cocoa/Cocoa.h>

using namespace std;

@interface NTestObjC : NSObject

     - (void) TestMethod;
@end

// ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()

class CCallback
{
public:
     virtual void DoCallback( void ) = 0;
};

// --------------------------------------

class CTestCpp : CCallback
{
public:
     CTestCpp( CCallback* inCallback )
          : mCallback( inCallback ) {}

     void DoTest( void )
     {
          mCallback->DoCallback();
     }
private:
     CCallback*     mCallback;
};

// --------------------------------------

template <class T1>
class CTestTemplate
{
public:
     CTestTemplate( T1 inConstParam, NTestObjC* inOCParam )
          : m_T1( inConstParam), mOCParam( inOCParam ) {}

     void DoTest( void )
     {
          CTestCpp     cpp( this );
          cpp.DoTest();
     }

     virtual void DoCallback( void )
     {
          @try
          {
               cout << "Template param is: " << m_T1 << endl;
               [mOCParam TestMethod];
          }
          @catch(NSException* e)
          {

          }
     }
private:
     T1               m_T1;
     NTestObjC*     mOCParam;
};


/*
 *  objcdispatch.cpp
 *  TestObjCDispatch
 *
 *  Created by Doug Hill on 1/23/07.
 *  Copyright 2007 Oracle Corp. All rights reserved.
 *
 */

#include "objcdispatch.h"

#include <stdio.h>
// --------------------------------------

extern "C" void DoMyTest( void )
{
     NTestObjC*     objC = [[NTestObjC alloc] init];
     CTestTemplate<int> tempTest( -999, objC );
     [objC release];
}

@implementation NTestObjC

     - (void) TestMethod
     {
          printf("In Objective C method.\n");
     }
@end


// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Objective-C++ now crashes (was "Objective-C exception handler blocks skipped")
      • From: Scott Ribe <email@hidden>
  • Prev by Date: Re: Creating a control in C++
  • Next by Date: Re: Unable to save files after perforce checkin/checkout
  • Previous by thread: Re: gcc4 optimization problems on intel mac
  • Next by thread: Re: Objective-C++ now crashes (was "Objective-C exception handler blocks skipped")
  • Index(es):
    • Date
    • Thread