Changing the background image?

If I associate a UIImageView that is being used for the background image in my view,
In the header file:
IBOutlet UIImageView *theBackground;
@property (nonatomic, copy) UIImageView *theBackground;
and @synthesize it, in the implementation file:
@synthesize theBackground;
that I ought to be able to dynamically change that image (for example, in viewDidLoad) with the following statement:
theBackground.image = [UIImage imageNamed:@"Default2.png"];
But all that happens if I try that is that the program starts up and crashes.
Default2.png is present.
Anybody have an idea what I am doing wrong?
Thanks,
doug

I think this is because UIImage does not conform to the NSCopying protocol
According to [The Objective-C 2.0 Programming Language|http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/A rticles/chapter5_section5.html], @property(copy) creates something like
if (property != newValue)
[property release];
property = [newValue copy];
(note that the implementation may not be exactly as shown).
So in your program, UIImage is being sent a copy message.
[NSObject Class Reference|http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSOb jectClass/Reference/Reference.html#//appleref/doc/uid/20000050-copy] wrote:
-(id)copy
*Return Value*
The object returned by the NSCopying protocol method copyWithZone:, where the zone is nil.
Discussion
This is a convenience method for classes that adopt the NSCopying protocol. _An exception is raised if there is no implementation for copyWithZone:_.
NSObject does not itself support the NSCopying protocol. Subclasses must support the protocol and implement the copyWithZone: method
Regards,
Thomas

Similar Messages

  • Create one button to change the background image

    Hello,
    can anyone help me create a button for a SPA525g phone which changes the background image of the phone which is now :
    <BMP_Picture_Download_URL group="User/Screen">http://192.168.2.2:5000/provisioning/logo/cisco525g.jpg</BMP_Picture_Download_URL>
    The button should also call to *1232
    So with button IN the image should change to ciscoOUT.jpg and call to *1232
    And button OUT should change the image to ciscoIN.jpg and call to *1231
    I now have already
    <PSK_1 group="Phone/Programmable_Softkeys">fnc=sd;ext=*[email protected];vid=20;nme=IN</PSK_1>
    I also tried to do :
    <PSK_3 group="Phone/Programmable_Softkeys">fnc=xml;url=http://192.168.2.2:5000/provisioning/logo/cisco_logo.xml;nme=scrp1</PSK_3>
    where cisco_logo.xml contains :
    <?xml version="1.0" encoding="utf-8"?>
    <CiscoIPPhoneImageFile>
      <Title>Image1</Title>
      <Prompt>Prompt1</Prompt>
      <LocationX>0</LocationX>
      <LocationY>0</LocationY>
      <URL>http://192.168.2.2:5000/provisioning/logo/cisco50xg.bmp</URL>
    </CiscoIPPhoneImageFile>
    but then nothing happens ? I can see the image and choose update , but that is it.
    Plus I want to combine the two option.

    anyone who can help me out here ??

  • Help me change the background image

    I just installed my copy of iWeb. The first thing I did after selecting a template was try to change the background.
    I hit the inspector button, found the tab with the background stuff, selected image fill, fit to size, and chose my photo. And nothing happened.
    Then I hit the media button, selected photos, dragging a photo to the background image in the inspector and nothing happened.
    What is the secret to changing the background image?
    Thanks.

    I tried to delete everything but the background image that comes with the template and iWeb still refuses to change to anything I want to change it to.
    Any ideas? The application doesn't seem to be working for me.
    Also if I save a file, where on the local HDD does it get saved? When I hit save iWeb didn't allow me to set a file name, it apparently just saved the document somewhere in a place that I cannot find.
    I want to be able to do some quick down and dirty web pages and then bring them into Dreamweaver at a later date and FTP them to the web.

  • Can we resize and change the background image in a 2 page layout?

    I am a two page layout report in RTF. Can I use different background image on page 1 and page 2? The first page background will not be repeated but the second page will. Also, it seems when we insert a background image by going "Format -> Background -> Fill effect -> Picture", after we finished the whole process we can't get the background image to fit with the page, can we resize it to be fit with the page? Thanks for your help!

    Yes.  Select the image and go to the Inspector/Hyperlink/Link pane and use the Link to One of my Pages option.
    Remember: the photo must be added to the page by dragging it onto the page and then be selected.  It can't be added as a background image with the Inspector/Page/Layout pane.
    OT

  • How can I get a parallax effect with Hub Control or change the background image scroll rate?

    Like the title says, I'm trying to get more of a parallax effect with a Hub Control in Windows Phone. In my current hub app, the picture has to be as wide as the entire hub, and it scrolls through the picture quickly. I'd like a way to make the background
    image scroll slower than the content on top of is.
    I've looked everywhere in the API docs, but I can't find anything saying how to do this. :(

    Hi PTK7,
    Yes, currently there is no documentation for this effect, however we can manually control the image scroll speed:
    http://stackoverflow.com/questions/10589192/windows-8-gridview-parallax-background-image
    Also I found a sample from code center:
    https://code.msdn.microsoft.com/windowsapps/ParallaxBackground-A-Metro-f929e558, take a look to see if these helps.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to change the background image on IP Phone 8861

    Hi Concern,
    I face some problem on changing background image on IP Phone 8861. I prepare 
    .png file as per below doc.
    Full size image - 800 pixels (width) X 480 pixels (height).
    Thumbnail image - 159 pixels (width) X 109 pixels (height).
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cuipph/8811_8841_8851_8861/10_5/english/adminguide/P881_BK_A92A3B94_00_adminguide-8811_41_51_61-10_5/P881_BK_A92A3B94_00_adminguide-8811_41_51_61-10_5_chapter_01010.html#P881_RF_C8927D88_00
    I upload the png and List.xml on cucm 10.5 as per above doc.
    List.xml Example 
    <CiscoIPPhoneImageList>
    <ImageItem Image="TFTP:Desktops/800x480x24/TN-Fountain.png" URL="TFTP:Desktops/640x480x24/p1-800X480.png"/>
    <ImageItem Image="TFTP:Desktops/800x480x24/TN-FullMoon.png" URL="TFTP:Desktops/640x480x24/p2-159X109.png"/>
    </CiscoIPPhoneImageList>
    Now i go to phone set and check new background picture not shows it says "no wallpaper server" something like that. 
    Please help on the issue. 
    Thanks
    Afzal

    Hi Jaime,
    Thanks is done .. 
    On dx650 phone background change is same procedure or different.
    File size is different i know but list.xml is same or different ?
    Or i can upload only one list.xml file just line add for dx650 phone.
    Thanks
    Afzal 

  • [Solved] -Change the background image of gdm login screen.

    When I first installed Arch I found that the default background image of gdm login screen ( or lock screen ) didn't look good with the desktop image that I had, so when I installed I looked for a way to change this. Sadly I could not find any direct and easy way, I looked in forums, I looked in gconf-editor and I could not find any relevant information about it. So I decided to look for the file and change it.
    This was not the best option, clearly since now that I installed Gnome 2.30 it replaced the image with the old one and I had to change the file again. Since maybe some other people are having similar problems I thought I could just post the place where gdm is looking for the file, and if somebody has any suggestions about how to change it with a better way, I would welcome it .
    After the longest intro to a directory, here it is: /usr/share/pixmaps/backgrounds/gnome/background-default.jpg
    Thank you .
    Last edited by agomezh (2010-04-11 18:53:09)

    Not to belabour the point, but after much hair pulling, I stumbled upon the following method, and it works perfectly. It sets the default background (for GDM login, Lock, desktop...etc.) for Gnome to whatever you want--even new users get the new default background on their desktop, although they can obviously change it, this is only the default. The page also shows a method of doing the same as gnome-appearance-properties method with just gconftool-2. I hope this doesn't just cause confusion.
    [Note: It still has to be run as root of course. I used sudo.]
    http://library.gnome.org/admin/system-a … n#gconf-20
    gconftool-2 --direct \
    --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults \
    --type string \
    --set /desktop/gnome/background/picture_filename some_picture_filename.png

  • How do I change the background image for a single tab on the navigation bar

    I'm creating a movie website for TDKR and for the navigation bar, I intend to have a different character for each tab. However, I'm having trouble putting a single image each separate tab. Instead one image appears on each of the tabs. Here's an example of the source and CSS.
    <td width="200"><ul id="navigation"><br />
          <li><a href="../pages/index.html">Home</a></li><br />
          <li><a href="../pages/cast.html">Cast</a></li><br />
          <li><a href="../pages/pictures.html">Pictures</a></li><br />
          <li><a href="../pages/soundtrack.html">Music</a></li><br />
          <li><a href="../pages/interview.html">Interviews</a></li><br />
          <li><a href="../pages/links.html">Links</a></li><br />
        </ul>
        </td>
    #navigation {
              list-style-type: none;
              padding: 0px;
              margin: 0px;
    #navigation li {
              margin: 0px;
              padding: 0px;
              list-style-type: none
    #navigation li a:link, #navigation li a:visited {
              display: block;
              width: 200px;
              height: 100px;
              text-decoration: none;
              text-align: center;
              line-height: 100px;
              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
              font-weight: bold;
              -webkit-transition: 1000ms ease;
              -moz-transition: 1000ms ease;
              -ms-transition: 1000ms ease;
              -o-transition: 1000ms ease;
              transition: 1000ms ease;
              color: #648AAE;
              background-repeat: no-repeat;
              background-image: url(../Images/gifs/Batman-still-2.gif);
              background-position: center bottom;
              text-transform: uppercase;
              letter-spacing: 0.79em;
              border-radius: 5px;
    #navigation li a:focus, #navigation li a:hover, #navigation li a:active {
              color: #000000;
              background-image: url(../Images/gifs/Batman-animation-2.gif);
              background-repeat: no-repeat;
              background-position: center bottom;
              background-color: #454545;
              border-radius: 25px;
    So, how do I put a single image on each tab (home, cast, pictures, etc). Thank you for your help in advance.

    Assign a class to the item and use CSS to apply an image as in
    <li><a href="../pages/index.html" class="home;">Home</a></li><br />
    <li><a href="../pages/cast.html">Cast</a></li><br />
    <li><a href="../pages/pictures.html">Pictures</a></li><br />
    <li><a href="../pages/soundtrack.html">Music</a></li><br />
    <li><a href="../pages/interview.html">Interviews</a></li><br />
    <li><a href="../pages/links.html">Links</a></li><br />
    and the CSS
    #navigation li a:link.home, #navigation li a:visited.home {
         background-image: url(../Images/gifs/Batman-still-2.gif);

  • Can you change the background image in IP Communicator

    Can you load an image file from you local workstation as the background in IP communicator?

    The first image worked great, but...
    I made and applied all the correct directories, images, and files needed for the custom background.
    I tested it on IP communicator and it worked great, with the image showing up as selection 2.
    Then I added another image selection; meaning I added the formatted image files and edited .xml file.
    Restarted IP Communicator and it still only shows the 1st custom image I created.
    I have checked and rechecked the .xml file along with the formatting of the images and still only 1 custom image is there.
    Ideas -
    Maybe there is a ?reload? command that I need to use on the phone itself?
    Is there any difference if the image is loaded on a Subscriber or Publisher
    - Currently I have it loaded on a subscrber that I also have confirmed that is set as the TFTP server for the IP Communicator.
    Thanks for any help you can provide on this issue.

  • Changing the background image on a panel header

    I just need to get a gradient image to display on panel header. I've gotten a custom skin to work and it seems to display properly in JDeveloper but not in IE or Firefox (really just need IE).
    I was trying
    af|panelHeader {
    background-image:url("/images/windowlet.gif") repeat-y;
    color: black;
    font-weight: bold;
    font-size: 12px;
    position: fixed;
    }

    Hi Dan,
    You might want to take a look at the following thread:
    Re: ADF Skinning panelbox:header
    It's about ADF Skinning panelbox:header
    I explain there something about path settings and that you probably have to user the reference to your J2eewebcontext-root.
    Good Luck
    Luc Bors

  • Changing the background image of a canvas at runtime

    =========
    [Bindable]protected var bgImage:Image; private
    private   function GetConfigurationResult( event:WsVCIGetConfigurationDataResultEvent):void
    var simage:String = event.result.Image; 
    var decoded:ByteArray; 
    decoder.decode( simage );
    decoded = decoder.toByteArray( );
    bgImage.data = decoded;
    setStyle(
    "backgroundImage", "assets/images/marshes2.jpg" ); 
    =========
    The code above is the result event from a call to a web service to get the contents of an image file from and SQL database.
    Works ok up to bgImage.data = decoded;
    But using "setStyle" has no parameter for passing the bytearray data block of the image.
    The above code, calling [ ("backgroundImage", "assets/images/marshes2.jpg" ] does something, but not what I want.
    The web service is called from the canvas [ initialize="init();"] function.
    When I set canvas feature [ backgroundImage="{bgImage}" ] it resolves, but I get some error trap from some low level image handling module.
    How do I resolve a background  image during load at runtime?

    Since setStyle takes a string and an object for inputs, one would expect that the following would work
    ===========
    private function GetConfigurationResult( event:WsVCIGetConfigurationDataResultEvent):void
    {// retrieve the 64base encoded image from the web service by ResultEvent
    var  
    bgImage:Image =new Image();
    var simage:String = event.result.Image; 
    var decoded:ByteArray;
    var  
    decoder:Base64Decoder = new Base64Decoder(); 
    decoder.decode( simage );
    decoded = decoder.toByteArray( );
    bgImage.data = decoded;
     setStyle(
    "backgroundImage", bgImage );
    ============
    But this generates the following error:
    ==========
    Error: Unable to load 'Image52'.
    at mx.skins::RectangularBorder/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\fr amework\src\mx\skins\RectangularBorder.as:237]
    at mx.skins.halo::HaloBorder/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\fram ework\src\mx\skins\halo\HaloBorder.as:222]
    at mx.skins::ProgrammaticSkin/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\skins\ProgrammaticSkin.as:421]
    at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:622]
    at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:677]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]
    at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]
    ==============
    But passing a filename to setStyle works!!!!
    But I need the image to come from a database!!!!!!
    Help!

  • How to make image stay still in background while content object scrolls over and change the background image?

    I'm fairly new to muse, so i bet it is a simple explanation to this. And don't know how to explain it in a good way. But i want the same effect as on this site http://themeforest.net/item/astlavista-multipurpose-muse-template/full_screen_preview/6459 513?ref=designrazzi . The photos stand still and changes while the blue/green content box slides over. Help anyone?

    I know how I scale the image to fill the browser. The effect I'm looking for is the transition from one image to another, as in http://themeforest.net/item/astlavista-multipurpose-muse-template/full_screen_preview/6459 513?ref=designrazzi. When the green/blue box with "services" scrolls over the screen, the image change from the one with the plane, to the one with the bike.

  • Changing the background color and image of CRM logon page

    Hi ;
    I want to change the background image and color, namely full style , I knew that the service "CRM_UI_START" of SICF under the section "error page" but there you can change a small image for header and footer area.
    At the same time , I looked at component "CRM_UI_FRAME" , I didnt find the right place to change the style of logon page.
    How can i insert an background image or change background color?
    Thanks

    Hi Maggie ;
    We use CRM 7.0 , I want to change the style of web logon page.
    Thanks
    Hi Tuncer,
    May I know your CRM release?
    Best regards,
    Maggie

  • How do you change a background image in an HBox control via actionscript?

    Hi All,
    I would like to change the background image of a HBox control
    when the user clicks on a tab (tabnavigator control). I call a
    function on the 'activate' method of a VBox control, within the
    TabNavigator. So for each of the tabs when a tab is selected an
    appropreate image is displayed in another part of the screen.
    Thanks for any insights/help
    regards
    Davej

    Binding a string variable and using the show() event instead
    of the activate event will work. See Below
    <mx:Script>
    <![CDATA[
    [Bindable]
    private var mystring:String = new String();
    private function dispAssocIMG(f3rd:String):void {
    mystring = f3rd;
    ]]>
    </mx:Script>
    <mx:HBox backgroundImage="{mystring}" id="first3rd"
    width="567" height="336" y="209"></mx:HBox>
    <mx:HBox id="mid3rd" width="457" height="336" y="209"
    x="567" backgroundColor="#956944">
    <!-- Tab Navigator -->
    <mx:TabNavigator height="336" width="457" >
    <mx:VBox label="about me"
    show="dispAssocIMG('image1.jpg')"></VBox>
    <mx:VBox label="test2"
    show="dispAssocIMG('image2.jpg')"></mx:VBox>
    </mx:TabNavigator>
    </mx:HBox>
    </mx:Application>

  • Changing the background by hovering over an object / triggering a jQuery script

    Thanks to this thread i managed to implement a js library called backstretch, which adds dynamically resized background images to either the whole site or objects.
    so far so good. Now i'm working on my portfolio page, and i want to change the background image when you're hovering over the thumbnail of an individual project like it was done here.
    So i guess the script has to be triggered somehow, but i don't know how to do that. Any ideas on how this could be achieved are highly appreciated.
    cheers,
    Rabauke

    Very simple.
    create a symbol with your background
    create the rotation in the symbol - select the background - select rotate at first frame - move playhead to the right - select rotate and change 0 to 360.
    add code to last frame at 360 degrees.
    var randomAColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16);
    sym.$('Ellipse').css({'background-color': randomAColor});
    sym.play(0);
    here is the sample:
    Randomly change color on rotation.zip - Box
    Also see this file that has different ways to randomize colors with rgba, names or hexadecimals.
    randomly change color of an element.zip - Box

Maybe you are looking for

  • I have upgraded from Mountain Lion to Mavericks, since then my Adobe Flash Player don't want to work?

    Hi, can anybody help me please, i have upgraded from Mountain Lion to Mavericks, since then my Adobe flash player don't want to work. I clicked on update and downloaded the update from Adobe and installed it. Every time i get an error saying - "that

  • Goods Receipt is allowed through MIGO  for PO's though they hav the confirm

    Goods Receipt is allowed through MIGO  for PO's though they hav the confirmation control key. where as its should allow based on ASN(inbound Delivery). Not sure if any system changes has to be made or anything else. please suggest. Thanks

  • EXEC SQL PERFORMING

    when run the following program ,it reported error as "the error occurred in the current  database connection "DEFAULT". how to solve the problem ? ================================= DATA : BEGIN OF WA,   CLIENT(3),   ARG1(3),   ARG2(3),   END OF WA. D

  • Dock consumes 100% of CPU and fan runs.  What to do?

    I have a 2010 MBP with SSD and VMWare (not Parallels).  Every so often, the dock cranks up to consume 100% of the CPU, and the fan runs.  The problem goes away when I reboot. I've tried quiting various applications, but it doesn't seem to make a diff

  • SAP BPC : Use of EVDNV

    When I use the EVDNV function, I get: javascript:var win=window.open('/osoft/Contents/WebContentsList.aspx?MODE=0&APPID=CFP:ENTITY=E04,TIME=2008.JUN,CATEGORY=ACTUAL&INTYPE=3','_top');location.refresh; Then I use the Hyperlink function in excel where