Custom NSView problems

Hi,

Having seen and played around with Pierre-Henri Jondots graphview framework (posted here on the 9th of april) i decided i would finally learn how to code cocoa by developing a very similar framework for 3D plotting using an OpenGL custom view.

I have knocked together some code (albiet very buggy with large memory leaks) which kind of works allowing me to plot a test data set. However, the only way I can get my code to work is if i generate the data to plot in my custom views drawrect method, which obviously is no use at all.

I tried to create some code which blatantly copies the code written by Pierre-Henri. However i have the problem that i can create some data outside of my custom NSView class and pass it in, but by the time i get round to drawing the data in drawrect the data has mysteriously disappeared.

If any one out there has any time to spare to look through my code to point out how this magic trick occurs i would be most grateful. I appreciate my code is probably very hard to follow and very poorly written but i have little inclination (or ability) to tidy it up until i can at least get it plotting something again.
Code
cheers

Huw Major

Where is the data

How do you know the "data has mysteriously disappeared"? Did you try to run in Debug mode and set up a breakpoint in your drawRect: method?

Data found

I had been stupid and reallocated my NSView so that my initial IBOutlet allocation was no longer valid. In other words i accidentally created 2 instances without realising it and only one of them (the one without any data) was actually outputting to my application window.

All the plotting code worked fine i just failed to call it correctly.

Thanks anyway