CocoaDev

Edit AllPages

Hi There…

I’m trying to create a ScreenSaver with the screensaver template in XCode. This is my first attempt at an app, so any help would be greatly appreciated.

I keep getting the error “invalid drawable” on the console when I run the saver. Any ideas?

Here’s the code I’ve got so far:

#import “ScreenTest2View.h” #define kRendererEventMask (NSLeftMouseDownMask | NSLeftMouseDraggedMask | NSLeftMouseUpMask | NSRightMouseDownMask | NSRightMouseDraggedMask | NSRightMouseUpMask | NSOtherMouseDownMask | NSOtherMouseUpMask | NSOtherMouseDraggedMask | NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask | NSScrollWheelMask | NSTabletPointMask | NSTabletProximityMask) #define kRendererFPS 100.0

@implementation ScreenTest2View

}

Again, any help would be greatly appreciated. I know I’m missing something simple here, but I can’t seem to figure it out.

Thanks, Alexandre


Why not just add a QCView as a subview? ScreenSaverViews are NSViews and as such you have the full set of view machinery available to you.


Ok, I did what you suggested… however it can’t seem to load my composition. It’s in the resources folder and everything, so I don’t understand why it’s having a problem. Here’s the code… again, help is greatly appreciated.

#import “ScreenTest4View.h”

@implementation ScreenTest4View

@end


When you’re a screensaver, you’re a plugin. As such, [NSBundle mainBundle] is not you, it is whatever app loaded you.

A bit of quality time spent with the debugger and NSLog would answer your question.


Thanks so much. I figured it out..