• 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
odd problems with NSData / OpenGL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

odd problems with NSData / OpenGL


  • Subject: odd problems with NSData / OpenGL
  • From: Henri Häkkinen <email@hidden>
  • Date: Tue, 8 Dec 2009 09:46:08 +0200

Hello.

I have odd problems with using NSData, maybe someone could point me what's going wrong here.

I have a simple Cocoa document-based application, which uses a custom NSOpenGLView derived class. This view object has a reference to the document object (this binding is set in the nib file), and the document has a reference to a Mesh class. Mesh loads vertices and indexed triangular faces from a file, and stores them as NSData objects containing vertex arrays, intended to be used with glVertexPointer etc. OpenGL calls.

The mesh is drawn in drawRect: of the view class using OpenGL. First call of this method works fine and the mesh is rendered. However, after calling setNeedsDisplay (for example in reshape method or anywhere) the program crashes with EXC_BAD_ACCESS when the drawRect method is trying to access the NSData objects of the mesh. Using the debugger I can see that the pointers (both the document reference, mesh reference and the NSData pointers inside the mesh) remain the same between the calls of drawRect:, as in nothing seems to get overwritten accidentally or anything.

What might be causing this problem? Any ideas?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: odd problems with NSData / OpenGL
      • From: David Duncan <email@hidden>
  • Prev by Date: Re: nscalendardate with 10.4
  • Next by Date: Re: Tracking Multiple Touches For Appropriate Label
  • Previous by thread: Re: Fwd: nscalendardate with 10.4
  • Next by thread: Re: odd problems with NSData / OpenGL
  • Index(es):
    • Date
    • Thread