• 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
Using other classes in ScreenSavers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using other classes in ScreenSavers


  • Subject: Using other classes in ScreenSavers
  • From: Angela Brett <email@hidden>
  • Date: Fri, 4 Jan 2002 23:10:56 +1300

Hi,

I'm having a bit of a problem with my screensaver. I have managed to get it working but it seems like there's probably a better way of doing it.

I want to use one of my classes (let's call it MyClass) in the screen saver, but if I put the files in the project and import the header file for MyClass in the ScreenSaverView subclass's header, I get runtime errors because MyClass is getting instantiated and sent the initWithFrame:isPreview: method which should go to my ScreenSaverView subclass. I've tried moving around the #import and a few things like that in case the compiler is somehow confusing MyClass for a ScreenSaver subclass, to no avail.

I've discovered that if I add the MyClass.o file to the project, it works. That doesn't seem like a normal thing to do though. Obviously other classes can be used in a screensaver when they're in one of the frameworks, so maybe the proper way to do it is to make a framework with my class in it... but that seems like overkill for just one class. Besides that, I'm not altogether sure I know how to make frameworks properly - it didn't work last time I tried. So is it okay to add the .o file to the project or is there a more usual way of doing what I'm doing?
--
Angela Brett email@hidden http://acronyms.co.nz/angela
"Great minds think different."


  • Follow-Ups:
    • Re: Using other classes in ScreenSavers
      • From: Bob Savage <email@hidden>
  • Prev by Date: Re: The ULTIMATE Cocoa Development Language
  • Next by Date: Are we all meanie-heads? No. (Was Re: The ULTIMATE...)
  • Previous by thread: Re: Command-delete shortcut in IB?
  • Next by thread: Re: Using other classes in ScreenSavers
  • Index(es):
    • Date
    • Thread