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: Peter Teeson <email@hidden>
- Date: Mon, 18 Mar 2013 13:13:28 -0400
On 2013-03-16, at 1:07 PM, Peter Teeson wrote:
> On 2013-03-16, at 12:24 PM, Keary Suska wrote:
>> On Mar 16, 2013, at 9:02 AM, Peter Teeson wrote:
>>> 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.
> Yes before I originally posted I did that and they were there.
>> 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.
> Ahah! Following your instructions I deleted them, added a Resources folder, re-added the images,
>> You may also need to make sure you choose "copy if needed", so that the images are added to the project folder.
> and selected copy as needed and it works now.
>
> The two things that were different than my original attempt were
> •adding a Resources folder and
> •copy as needed checkbox.
>
> I'll take another look in IB docs to see if this is documented.
>
> Thank you for your help and patience.
As a final comment that may help others in the future.
I tried looking in the Xcode User Guide but did not find anything helpful.
However Googling "Xcode project resource files" got me to the Resource Programming Guide at developer.apple,com.
In particular the Image, Sound, and Video Resources chapter has documentation.
The paragraph headed Images and Sounds in Nib Files has the relevant ones. This sentence could be slightly improved.
"To make image and sound resources available in a nib file, all you have to do is add them to your Xcode project; Xcode then lists them in the library pane."
"To make image and sound resources available in a nib file, all you have to do is add them to your Xcode project; Xcode then lists them in the Media library pane."
^^^^^^
Although I had added the images before I originally posted - for some arcane reason they just did not show up until I deleted them and followed your suggestions.
Clearly there is no need for a separate Resources folder beyond organizational requirements.
Lastly although the images show up when the app is Run they do not appear in the Simulator.
Thanks again for your prompting.
_______________________________________________
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