Re: How to set NSButtonCell image and alternate image using InterfaceBuilder
Re: How to set NSButtonCell image and alternate image using InterfaceBuilder
- Subject: Re: How to set NSButtonCell image and alternate image using InterfaceBuilder
- From: Keary Suska <email@hidden>
- Date: Sat, 16 Mar 2013 10:24:02 -0600
On Mar 16, 2013, at 9:02 AM, Peter Teeson wrote:
>
> On 2013-03-15, at 11:23 PM, Keary Suska wrote:
>> On Mar 15, 2013, at 1:31 PM, Peter Teeson wrote:
>>> Lion 10.7.5, Xcode 4.5.2
>>> I have set the Title and AlternateTitle using IB. But can't find out how to set the images using IB.
>>>
>>> The attributes Inspector for a NSButtonCell and for an NSButton both show fields for those images.
>> The NSButtonCell inspector has an "image" and "alternate" fields for specifying those images,
>> and they are really, really, obvious, so I wonder if there is something else more specific that you are having a problem with?
>
> Yes as I indicated I saw them - see above if you missed reading it the first time.
> I also stated that I was able to set the Title and Alternate titles.
> I Googled and searched the Apple docs for how to do it for images with no luck.
It seemed like you did see those, yes, but you asked how to set images in IB, and that is how--using those fields. So your question was likely something else that you did not say ion your original post, hence how I followed up.
> Anyway I had tried entering the names of the image files I added to the project
> but nothing showed up in the display of the nib either in simulation or running.
>
> Can you be more helpful by describing how you are able to do it?
So, the proper question is, why does IB not see the images that you added to your project? When images are properly added, they simply show and that usually works as expected.
First make sure they are really missing, by checking the pop-up list in the button cell inspector. Should be easy as they show in alphabetic order. If they don't show in the list, it means IB doesn't know the location that you put them. Make sure you add them to the "Resources" folder/group of the project. You may also need to make sure you choose "copy if needed", so that the images are added to the project folder. To be sure, I would remove them from the project (also move to trash so they are out of the project folder) and re-add them. If you use version control, make sure the "add" change has been committed before you delete them. Otherwise Xcode will screw it up.
If they still don't show, it could be a bug or corrupt cache. Close out Xcode and delete the subfolder under the DerivedData folder that corresponds to your project. Re-open and rebuild. That usually does the trick.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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