You should really consider placing this code someplace other than -viewWillDraw
. This routine can be called multiple times for the same NSView
under some circumstances and, more importantly, you need to call [super viewWillDraw]
to make sure that things will actually draw correctly (if anything is drawn in the view itself).
For periodic updates (such as every 10 seconds), you should consider using NSTimer
to trigger the retrieval of the next object.
As for the general question of why your image isn't being drawn correctly, you should probably consider putting the image retrieval and drawing code into the same structure as your label retrieval and drawing code. This will get the [dj setImage: artistImage]
method call outside of the viewWillDraw
chain which is likely causing some difficulty here.