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

dbrayford

macrumors member
Original poster
Feb 22, 2010
41
0
Hi,
I get the following error messages after a runtime crash. I am new to
development on Apple systems and cocoa and struggling to create the
native graphics window and attach it to the Java window.

Code:
2010-03-29 15:25:42.446 java[1075:13303] *** -[NSViewAWT Window]:
unrecognized selector sent to instance 0x125e50e30
2010-03-29 15:25:42.448 java[1075:13303] An uncaught exception was raised
2010-03-29 15:25:42.448 java[1075:13303] *** -[NSViewAWT Window]:
unrecognized selector sent to instance 0x125e50e30
2010-03-29 15:25:42.449 java[1075:13303] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '***
-[NSViewAWT Window]: unrecognized selector sent to instance
0x125e50e30'
2010-03-29 15:25:42.449 java[1075:13303] Stack: (
   140735396678428,
   140735358576847,
   140735396705371,
   140735396698852,
   140735396699192,
   4925828763,
   4925835145,
   4364215618,
   4364177150,
   4364177150,
   4364176694
)
terminate called after throwing an instance of 'NSException'
Abort trap


The section of cde that it crashes in:

Code:
       dsi = ds->GetDrawingSurfaceInfo(ds);
       if(dsi != NULL)
       {
               dsi_mac = (JAWT_MacOSXDrawingSurfaceInfo*)dsi->platformInfo;
               if( env->ExceptionOccurred() )
               {
                       env->ExceptionDescribe();
               }
       }

       std::cout << "Before NSView *view = dsi_mac->cocoaViewRef;" << std::endl;

       // get the corresponding peer from the calling panel
       NSView *view = dsi_mac->cocoaViewRef;

       std::cout << "Before NSView NSWindow *window = [view Window];" << std::endl;

       if(view)
               std::cout << "view !=null" << std::endl;

       // get the coregraphics from the parent window
       // ******crashes here*****
       NSWindow *window = [view Window];

       std::cout << "Before NSOpenGLPixelFormatAttribute attrs[]" << std::endl;

       NSOpenGLPixelFormatAttribute attrs[] = {

               NSOpenGLPFAScreenMask,

               CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay),

               NSOpenGLPFAColorSize, 24,

               NSOpenGLPFADepthSize, 16,

               NSOpenGLPFADoubleBuffer,

               NSOpenGLPFAAccelerated,

               0

       };

       NSOpenGLPixelFormat *pixelFormat;

       std::cout << "Before pixelFormat = [[NSOpenGLPixelFormat alloc]
initWithAttributes:attrs];" << std::endl;

       pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];

       std::cout << "Before initOpenGLView(env, panel);" << std::endl;

       initOpenGLView(env, panel);


       return 1;


David
 

JoshDC

macrumors regular
Apr 8, 2009
115
0
A view's window method should be spelt with a lowercase w. "Unrecognized selector sent to instance" simply means that an object's been asked to perform a method it doesn't have. In this case the incorrectly capitalized Window method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.