Newbie iPhone: How do I programatically set the text of a UIBarButtonItem?

Hello,
This is probably really more of a question on IBOutlets but here goes. I want to have an updateable label on my Toolbar. A label doesn't seem to "stick" on the toolbar so I figured I would drop a UIBarButtonItem on it and then just update the Title property of it to change the text as I needed. Problem is I can't figure out how to get a reference to the UIBarButtonItem in my code.
With a pure label control, I can drag from the File's Owner to the label in my view to make it an outlet for my ViewController and then access the text property of the label in code. With the UIBarButtonItem, I can't make it an outlet. I know the button is more of an action thing but I don't need to respond to taps, I just want to change the text.
Thanks for any help,
Tom

Tom,
You should be able to assign the UIBarButtonItem to an outlet as long as:
1) you have defined an instance variable in FilesOwner of UIBarButtonItem and prefixed it with "IBOutlet".
2) FilesOwner is set to your custom view controller in the Interface Builder's Inspector panel. If it still thinks it's a standard UIViewController it won't pick up your custom outlets.
All that being said, I'm not sure you can change the title without using a custom view. The default UIBarButtonItem has an initWithTitle: initializer that may be static (perhaps others know of a way to change it once set). But you can define a custom view for the button. That gives you the ability to add a UILabel and programmatically set the text of the label.
Cheers,
George

Similar Messages

  • How do I programatically change the text in a listbox that is contained in a cluster?

    How do I programatically change the text in a listbox that is contained in a cluster?

    In the front panel, right click on the listbox object and select create>attribute node.
    In the diagram click on the attribute node and select "Item Names".
    Connect the desired array of string to the attribute node.
    BigBen

  • I inadvertently pressed CTRL+ another key (possibly V or B or N) and the text size of my bookmarked page was significantly reduced in size. I can't read it. How do I re-set the text size?

    I mistakenly pressed CTRL + another key (possibly V or B or N or whatever), when I was reading my e-mail. The text size shrank to a size that is useless to me, but I cannot seem to get the text size re-set to normal. Indeed all of the formatting on the page has been reduced (symbols, instructions, frames etc). Existing Firefox and returning to the bookmarked page makes no difference. How do I re-set the system?

    Hi,
    Please try '''Ctrl''' + '''0''' (zero). Alternatively '''View''' ('''Alt''' + '''V''') > '''Zoom''' > '''Reset'''.
    [https://support.mozilla.org/en-US/kb/how-do-i-use-zoom?redirectlocale=en-US&redirectslug=Page+Zoom Page Zoom]
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]

  • How do I programatically set the date and time of my FP-2000 in LabVIEW RT?

    I checked out the following knowledgebase document which has a tool for setting the system time, but I also need to set the date:
    http://zone.ni.com/devzone/explprog.nsf/ 6c163603265406328625682a006ed37d/ 37175dbc3696a1ac86256a850051097d?OpenDoc ument
    How can I do this?
    -Jim

    That is great, Steven. I also found a solution using GetSystemTime and SetSystemTime which are functions in kernel32.dll that get and set the system date-time. This function call worked on the FP-2000 that I have and should work on RT-Embeded systes, as well.
    -Jim
    Attachments:
    GetSystemTime.vi ‏16 KB
    SetSystemTime.vi ‏14 KB

  • Programatically setting the IP address of a 8234 ethernet port in a specific PXI slot

    Hi, I have a system with multiple 8234 ethernet cards in a PXIe chassis.  Each port has its own subnet and IP address.  I need to ensure that the user never has to swap ethernet cables from port to port after a 8234 card is replaced.  I.e., how do I programatically set the IP address and subnet of a specific port in a specific slot?
    Any comments welcome.

    Hi ROgelio,
    You are right there is no way to assign IP address to physical interface.
    ace-4710-1/Admin(config)# int gigabitEthernet 1/1
    ace-4710-1/Admin(config-if)# ip ?
    % invalid command
    cdn-ace-4710-1/Admin(config-if)# ?
    Interface config commands:
      carrier-delay  Set port up delay value
      channel-group  Map physical port to port channel
      description    Interface specific description
      do             EXEC command
      duplex         Configure duplex operation
      end            Exit from configure mode
      exit           Exit from this submode
      ft-port        Make physical port specific for Fault Tolerance(FT)
      no             Negate a command or set its defaults
      qos            Configure QoS operation
      shutdown       Shut down the interface
      speed          Configure speed operation
      switchport     Set switching mode characteristics
    So there is no option to configure an IP address on physical interface.
    regards,
    Ajay Kumar

  • TS3992 How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but touch screen doesn't work to unlock the phone or select any

    How can I back up an iphone when I haven't set the phone up for back ups & the touch screen doesn't work? The phone can receive calls (not answer) & the pictures & messages can be seen but the touch screen doesn't work to unlock the phone or select anything. We want to save/transfer pictures, contacts, and music to the replacement phone.

    Try backing it up to your computer with iTunes.  Connect it to your computer, open iTunes, click on the name of the phone in iTunes, go to the Summary tab of your iTunes sync settings and click Back Up Now.  Also go to File>Devices>Transfer Purchases to transfer you apps and other purchased media to your iTunes library.

  • HT3577 I have an iPhone 4S and I have set the VoiceOver to off, but when I run with iTunes on, it still comes on. How do I stop this from happening?

    I have an iPhone 4S and I have set the VoiceOver to off, but when I run with iTunes on, it still comes on. How do I stop this from happening?

    This is from article on device with multiple computers:
    iPod shuffle and iPhone are intended for use with a single computer. You cannot load music from multiple computers or iTunes libraries onto iPod shuffle and iPhone like you can with other devices.
    http://support.apple.com/kb/HT1202

  • HT5622 I have just received a new iphone 5s and need to set the Apple ID with my work email.  I used my work email on my personal iphone 4s to set up an icloud account and it will not let me use my work email as the Apple ID on my new iphone. What do I do

    I have just received a new iphone 5s and need to set the Apple ID with my work email.  I used my work email on my personal iphone 4s to set up an icloud account and it will not let me use this email as the Apple ID on my new iphone.  As it is a work phone I need to use this email address as my Apple ID.  How do I do this?

    when you open the app store scroll down to the bottom it will display the apple id currently in use, change it to your normal apple id email

  • How to set the 'text' property of a 'Header' region dynamically?

    Hi,
    I have a requirement to display the 'text' property of a 'Header' region, based on a query.
    So I need to set the text property programatically in CO.
    Can I use setText("..") by getting the handler to the 'Header' region?
    If so, How to get the handler for the 'Header' region?
    Message was edited by:
    user594528

    How to get the handler for the 'Header' region to call the setText()?
    OAHeaderBean Header1 = (OAHeaderBean)...........................
    Header1.setText("....");

  • How do I programaticly change the header BG color on a multiline listbox

    How do I programaticly change the header BG color on a multiline listbox

    Hi,
    If you mean the multicolumn listbox then you have to create the its property node on the diagram (right click on the item and select "Create->property node" from pop-up menu). Then you have to select two properties:
    "Active Cell"
    "Cell Background color".
    You can do it by expanding prperty node to 2 rows and right clicking on each row. Then select "Properties" from pop-up menu and the appropriate property.
    Then you have to set-up "active cell" to the appropriate coordinates of the column header. (row=-1; column=N or column=-2 if you want to change the colors of all headers).
    Now you have to connect the appropriate colorbox or numeric variable to "Cell Background color" property node and run the program.
    I've attached the example.
    Good luck/
    Ole
    g Chutko.
    Attachments:
    Color.vi ‏15 KB

  • TS3694 I am trying to restore my ipod and it stopped moving before the restoration was completed. How do I re-set the ipod. I can't turn it off.

    How do I turn off I pod touch?   The restore screen is stuck

    Thanks for the assistance.  I was able to restore my I pod after letting the battery run down.  I then synced the I pod to my new computer.  Most of the songs moved from the cloud to the actual I pod drive.  But, many of them did not.  I tried downloading them from the cloud on my I pod, but this didn’t work.  Will I be able to restore the missing songs?  Thanks, Cleveland.
    Sent from Windows Mail
    From: Apple Support Communities Updates
    Sent: Sunday, November 9, 2014 4:52 PM
    To: shircleve
    You received a reply
    lllaass has replied to your question. You can view the full discussion in Apple Support Communities.
    I am trying to restore my ipod and it stopped moving before the restoration was completed. How do I re-set the ipod. I can't turn it off.
    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable              
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     
    Correct Answer  Helpful Answer 
    Use the buttons above to tell lllaass and the rest of the community if this reply solved your question or helped you get closer to finding a solution.
    To reply to lllaass, go to the discussion in Apple Support Communities.
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM. Cupertino, CA 95014.
    All Rights Reserved | Privacy Policy | Terms of Use | Apple Support

  • How can I re-set the App Store so the Updates will again appear under the Updates tab?

    Hi,
    I am running a Macbook Pro (retina). Lately when I launch App Store and click on Updates the software updates for the software on the Macbook do not show up under the Updates tab. However, when I go to the Purchased tab I see there Update buttons next to programs that have updates ready to download.
    How can I re-set the App Store so the Updates will again appear under the Updates tab?
    Many Thanks,
    David

    Wanna know this too

  • I've had a hard drive crash and put in a new one.  However iTunes has or list all of them from my old drive.  How do we re-set the directory

    I've had a hard drive crash and put in a new one.  However iTunes has or list all of them from my old drive.  How do we re-set the directory?

    You can re-download the software from Download CS5.5 products
    Install and enter your serial number when prompted.
    Find your serial number quickly

  • How do you set the text of a Hyperlink component in code

    I am using Visual Web pack in NB 6.0. How do you set the text of a hyperlink component in code?
    Please see screenshots at
    http://coba.usf.edu/departments/isds/faculty/agrawal/projects/java/
    I have a hyperlink in a grid panel. I am using
    hyperlink1.setText("Hello"); in prerender(),
    but the Hyperlink shows up with the text "Hyperlink", whereas I was expecting "Hello". However,
    hyperlink1.setUrl("http://www.usf.edu"); works as expected.
    I tried nesting a static text in the hyperlink as suggested in the Creator guide (ed 2, Google project). I deleted the "Hyperlink" text in the properties editor but then the page turned out blank.
    Thanks
    Manish

    Hi Manish,
    Great to know you were able to fix your issue. The following blog entry has the list of resources you would like to look at for future.
    http://blogs.sun.com/NetBeansSupport/entry/useful_resources_for_visual_web
    Thanks
    K

  • How do you set the Text in an Accordion Interaction?

    When trying to set the text in the Accordion Interaction, it behaves very strange. You can't set it. It starts out at 13 and then changes to either 10 or 30.
    Can anyone give some advise on how to set this?
    Thanks.

    Hello,
    Logged that bug (as well, have a long list). Workaround depends on your hardware: for some scrolling the mouse wheel will allow to change font size (doesn't work for me). On my Lenovo Thinkpad I have to use the trackpad, that has a scrollbar, to change the font size. Very cumbersome, was promised that it would soon be patched, crossing my fingers.
    Lilybiri

Maybe you are looking for

  • Using Right-justified and left zero-filled condition in message mapping of

    Hi, My Interface is outbound Interface. Suppose source field named 'MobNumber' is mapped with Target field named 'MobileNumber'.Condition is AS IS(Right-justified and left zero-filled). How should i do this mapping? Thanks, Sanghamitra

  • How to apply 11i July CPU Pathes.

    Hi How to apply Apps 11i July CPU Patches OS: Linux.. Thanks in Advance.

  • My Socket script do not receive data, HELP!

    I write this script to get infomation from a Half-Life CS server. Use the script below, I can connect to the server and send my query string, But nothing response to me! Why? Please help me ! Thank you very much !!! import java.net.*; import java.io.

  • Dreaded Error 2096

    I just recieved the iPod Touch. Anxious to get it started, I went on to Apple in order to download the version 8 iTunes as well as the newest version of Quicktime Player. At first, I encountered the "compatibility" error for Quicktime; so I turned it

  • Returns item problem

    Hello everybody, I have a problem with the following process: 1. User creates a purchase order with returns item checked (it's internal return     within the same company code) 2. User uses transaction VL10B to create delivery note 3. MIGO transactio