• 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: Custom component fails to load images by name in a IBPlugin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom component fails to load images by name in a IBPlugin


  • Subject: Re: Custom component fails to load images by name in a IBPlugin
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 19 Sep 2008 12:15:41 -0700

On Sep 19, 2008, at 10:21 AM, Dalzhim Dalzhim wrote:

I have packaged this component in a IBPlugin and designed a custom inspector to configure my custom component at design time by entering the names of the required images. However, my component fails to load the images when it is being configured in Interface Builder. It also used to fail to load when I ran the application which uses the framework which includes this ibplugin, but I already fixed that by searching for the image in the mainBundle.

When your plug-in is run under Interface Builder, +[NSBundle mainBundle] will return Interface Builder's bundle rather than your application's bundle. Your view might want to look for the resources in its bundle — e.g., the bundle returned by [NSBundle bundleForClass: [MyView class]] — for its images.


That way, when your view class is compiled into the Interface Builder plug-in it will look in the plug-in for its images, and when it's compiled into your application it will look in your application for its images. And if you move your view to a framework that's used by both your application and your Interface Builder plug-in, you can move its images along with it and they'll be found there as well.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Custom component fails to load images by name in a IBPlugin
      • From: "Dalzhim Dalzhim" <email@hidden>
References: 
 >Custom component fails to load images by name in a IBPlugin (From: "Dalzhim Dalzhim" <email@hidden>)

  • Prev by Date: Re: How do I view the retain count in Xcode's debug window?
  • Next by Date: Re: Xcode 3.1 and Java
  • Previous by thread: Custom component fails to load images by name in a IBPlugin
  • Next by thread: Re: Custom component fails to load images by name in a IBPlugin
  • Index(es):
    • Date
    • Thread