• 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
Re: ScreenSaver & Bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ScreenSaver & Bundles


  • Subject: Re: ScreenSaver & Bundles
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 11 Apr 2002 01:43:39 +0200

On Wednesday, April 10, 2002, at 10:57 , Michael P. Rogers wrote:

I'm trying to bring an image in my resources folder into a ScreenSaverView. But this code:

imagePath = [ [NSBundle mainBundle]pathForResource:@"map" ofType:@"gif"]
;

gets me null, although map.gif is in the resources folder of my .saver.

Hmmm... I haven't done savers yet, but I guess a saver is not an application by itself, but just a loadable bundle used by some other app? If so, the behaviour is quite all right. You don't want the main bundle (which represents the main app which loads your bundle); you want the bundle of your .saver. The most common way would be something like

[NSBundle bundleForClass:[self class]]

See NSBundle docs for more.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >ScreenSaver & Bundles (From: "Michael P. Rogers" <email@hidden>)

  • Prev by Date: Timing issue
  • Next by Date: Re: NSTableView reloadData question FOLLOWUP
  • Previous by thread: ScreenSaver & Bundles
  • Next by thread: Re: ScreenSaver & Bundles
  • Index(es):
    • Date
    • Thread