2

I am creating a music-eduaction app that reads in musical scores - not audio files - and will need to present an animated graphical screen. I created a document-based app to make file access easy, and I have it now reading and parsing the files, and I have all the song data stored in my Obj-C classes. I also have a textview in my xib that I can write song attributes and other text tidbits to. Now I want a second view, which needs to be graphical and animatable, for the music. I am an Xcode novice, but have some openGL experience. My setup is latest OS and Xcode versions.

When I try to drag the OpenGL View into my window in IB, I get a weird error/warning that says "Unsupported Configuration - NSOpenGLView in One Shot memory enabled window" (so that is weird), and the openGL view does not appear when I run the app.

I can't find much reference to OpenGL Views in NSdocuments on this site, or anywhere else, which makes me think I might be trying to do something that is not meant to be done. Does anyone have any advice for me? Should I not use a document-based app? Should I use something other than openGL? Or maybe I need to build the openGL View and View Controller 100% programmatically in this case? Any advice or pointers to some applicable samples/tutorials would be a huge help.

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

3

Try disabling the "One Shot" option from the Windows's memory attributes in Interface Builder.

From NSWindow documentation:

setOneShot: Sets whether the window device that the window manages should be freed when it’s removed from the screen list.

- (void)setOneShot:(BOOL)oneShot

Parameters

oneShot YES to free the window’s window device when it’s removed from the screen list (hidden) and to create another one when it’s returned to the screen; NO to reuse the window device.

Discussion

Freeing the window device when it’s removed from the screen list can result in memory savings and performance improvement for NSWindow objects that don’t take long to display. It’s particularly appropriate for NSWindow objects the user might use once or twice but not display continually.

Community
  • 1
  • 1
Rivera
  • 10,792
  • 3
  • 58
  • 102