UITabBarController - Adding/Removing items

Hi,
Can anybody tell me how can I add or remove a ViewController item from a tabBarController at runtime? Or is there some way to update some item's specific ViewController at runtime?
I m using a webview which loads different url each time, I want to update its tabBar item acordingly, so that the user should be able to view the latest webpage.

Aatif wrote:
Can anybody tell me how can I add or remove a ViewController item from a tabBarController at runtime? Or is there some way to update some item's specific ViewController at runtime?
You can do both. The tabbar has a list of controllers that you can assign. Unfortunately I haven't seen anyway to manipulate the list directly so you have to create a new array and reassign. Like this:
NSMutableArray* controllers = [[tabbar.viewControllers mutableCopy] autorelease];
[controllers insertObject:newVC atIndex:0];
[tabbar setViewControllers:controllers];
If you're doing a simple append you can shorten it a bit:
[tabbar setViewControllers:[tabbar.controllers arrayByAddingObject:newVC]];
If you want to 'update' a view controller at runtime, you simply grab the controller you want from the controllers array and modify it... can't help much further without knowing what you're having trouble with.

Similar Messages

  • Adding/Removing items from the main menu

    I don't know why my iPod won't let me add or remove items from my main menu.
    I go
    Settings > Main Menu > (check what I want on the main menu) > Reset Main Menu > Reset
    When I go out to the main menu again, nothing has changed.
    Anyone else having this problem? Thank you for help!

    If you do a reset then you're resetting it to default. If you want to change anything ya just change it to on/and or off, then hit the menu button to go back. Don't go all the way to reset. Hope this helps.

  • FM or BAPI for adding/removing maintenance items(Tcode IP02).

    Hello All,
    I need to change Maintenance plan by adding/removing maintenance items(Tcode IP02). Please let me know availaible FM or BAPI for the same.
    Regards,
    Vimal

    Hi,
    use the following steps to find a BAPI for any transaction
    1.Open transaction SE24.
    2.Now open the object CL_EXITHANDLER in display mode.
    3.Go to the method tab and double click on the method GET_INSTANCE.
    4.Put a break point on cl_exithandler=>get_class_name_by_interface.
    5.Now execute the transaction you want to find BAPI for, it will take you to the above method.
    6.Write EXIT_HANDLER in fieldnames and hit enter, it will tell you the BAPI used for your transaction.
    7.Hit F8 and it will tell you all the BAPIu2019s for your transaction.
    some of the FM's are
    PM_MHIS_UPDATE
    MEASUREM_POINT_UPD_PYEAR
    Regards,
    Manish

  • How do you remove items from the assets panel that are duplicated?

    How do you remove items from the assets panel that are duplicated?

    If you add an item to a slideshow, you'll usually see 2 entries for that image in the assets panel - one represents the thumbnail, and the other represents the larger 'hero' image.
    It sounds like you may have added the same image to your slideshow twice. You can select one of the hero images or thumbnail images in your slideshow and use the delete key to remove it. Then the extra 2 entries in the assets panel should disappear.

  • Can I remove items from the Services menu?

    I think the subject line says it all: can I remove items from the Services menu? I have a number of items in the Services menu that I never use and I would like to make the menu shorter to make it easier to access the items that I do use.

    There are a couple of things you could try. There's an application called Service Scrubber that is supposed to do this. But the web page says it's for 10.4, though it says it might work on 10.3
    Alternatively, you can edit the Info.plist or Info-macos.plist file in each application bundle to remove its service from the Services menu. This post at Mac OS X Hints has a pretty detailed description of how to do it. I tried this on my iMac running 10.3.9 and it worked just fine.
    Don't know about the Service Scrubber app, but if you edit the plist files, you'll need to log out and log back in before the changes take effect.
    Also, if you decide to edit the files by hand, I'd suggest just renaming NSServices by adding an "x" to the front or something, rather than deleting the item completely. That makes the changes easier to reverse.
    charlie

  • Not able to remove items from initiative

    Hello All,
    We are on PPM 5.0 and I am trying to remove added items from the 'initiative' but I am not able to remove them.
    Can someone kindly help, as to what might be preventing from removing items from initiatives.
    Thanks,
    Sachin

    Hi,
    If you want to remove the Items from Intiative , you need remove the relationships object . Not possible to delete directly !
    Steps :
    Navigate to the Relationships tab , then go to the Sub tab Related Objects , select the Item  and click Delete Assignment. You will remove the Item from Initiative dashboard !
    Hope it works for you !
    Regards,
    Vincent
    Edited by: ddd002 on Oct 4, 2011 6:53 AM

  • Removing Items from a TextArea/Pane Component

    Hi All,
    I have a question about text containers. Basically I'm reading Strings from a file and I'm displaying them inside a JTextArea. I'm adding new Strings to the JTextArea using it's append() method. Is there a way to limit how much stuff should the JTextArea hold ? After a while my application crashes with the following message:
    java.lang.OutOfMemoryError
         <<no stack trace available>>
    Exception in thread "main"
    This is because so much stuff got accumulated in the JTextArea that it eats up all available memory and the app crashes. My question is; is there a way I can remove items from the JTextArea ? Or is there a way to limit the size/number of Stings it can hold ? Or should I be using something else instead of the JTextArea ? Thanks in advance...
    -Pete

    int size = textArea.getDocument().getLength();
    gives the total number of bytes in the text area. You can then use:
    textArea.replaceRange("", 0, 80);
    to remove 80 characters from the start of the text area. Or to remove the first line from the text area use:
    int start = textArea.getLineStartOffset(0);
    int end = textArea.getLineEndOffset(0);
    textArea.replaceRange("", start, end);
    Design your own routine to keep the text area at a reasonable size.

  • Battling JComboBox behavior of removing items

    we are working on a document browser GUI and encountered some weird behavioral issue with JComboBox/DefaultComboBoxModel. The current workaround is ugly and we are wondering if there is somehow different way to get it to work.
    Our application uses an in-house class to keep a list of documents, and this class has APIs for navigation and deletion so forth. On the GUI, we display a JComboBox to show the name of the current document being viewed. This JComboBox is backed by a DefaultComboBoxModel which has a separate list containing only the names of the document. When a user selects a document from the JComboBox, the application jumps to the selected document, and when a user deletes a document, the corresponding document name is removed from the JComboBox.
    The problem is that our in-house class behaves differently than DefaultComboBoxModel. When an item is removed from the in-house class, it points to the next item on the list (i.e. the index value renames the same), unless the last item of the list is removed, and then the index simply points to the new last item of the list. This behavior is intuitive and is in conformation to user requirements.
    However, the DefaultComboBoxModel does the opposite with some oddity. When an item is removed from the ComboModel, the selectedIndex points to the previous item the list (i.e. the index value decrements by 1), unless it is the first item of the list, in which case it behaves even more oddly... it points to the next item in the list, but for some reason, the selectedIndex becomes 1 (instead of 0) as if the item to be deleted is still in the list!
    So we have been having trouble keeping the in-house class and the JComboBox in sync. For one thing, when a user deletes a document, it renders twice for the next document to be viewed (one triggered by JComboBox automatically points to the previous doc, which is incorrect, and the second one is our code that forces JComboBox to select the next doc by setting selected index), and problems occur especially for the boundary cases. We ended up doing a hack - add an ActionListener to the JComboBox only when it receives a mouse-down event and remove the actionListener inside of the actionPerformed() code, so that we can force the JComboBox to display the correct document name without triggering document rendition.
    But this is ugly. We are wondering if there is a better way. One possibility is of course to ditch the defaultComboBoxModel, and implement a mutableComboBoxModel in our in-house class. But is there another way (easier way so we dont have to deal with triggering events etc)? Thanks.

    And the way to solve it with a custom MutableComboBoxModel (also does not auto select an item that is added):
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    public class ListComboBoxModel extends AbstractListModel implements MutableComboBoxModel {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    ListComboBoxModel model = new ListComboBoxModel("one", "two", "three");
                    model.setSelectionChangeOnRemove(SelectionChange.SELECT_NEXT);
                    final JComboBox comboBox = new JComboBox(model);
                    comboBox.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            System.out.println("Selected: "
                                    + comboBox.getSelectedIndex()
                                    + "=" + comboBox.getSelectedItem());
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(comboBox, BorderLayout.PAGE_START);
                    frame.getContentPane().add(
                            new JButton(new AbstractAction("Delete") {
                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    int index = comboBox.getSelectedIndex();
                                    System.out.println("Before: " + index
                                            + "=" + comboBox.getSelectedItem());
                                    comboBox.removeItemAt(index);
                                    System.out.println("After: "
                                            + comboBox.getSelectedIndex()
                                            + "=" + comboBox.getSelectedItem());
                                    setEnabled(comboBox.getItemCount() > 0);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
        public enum SelectionChange { SELECT_PREVIOUS, SELECT_NEXT, CLEAR_SELECTION }
        private final List<Object> items;
        private SelectionChange changeOnRemove = SELECT_PREVIOUS;
        private Object selected;
        public ListComboBoxModel(Object...items) {
            this.items = new ArrayList<Object>();
            if(items != null) {
                this.items.addAll(Arrays.asList(items));
        public void setSelectionChangeOnRemove(SelectionChange changeOnRemove) {
            if(changeOnRemove == null) {
                throw new NullPointerException("SelectionChange should not be null");
            this.changeOnRemove = changeOnRemove;
        @Override
        public int getSize() {
            return items.size();
        @Override
        public Object getElementAt(int index) {
            return items.get(index);
        @Override
        public void setSelectedItem(Object anItem) {
            if((selected != null && !selected.equals(anItem))
                    || (selected == null && anItem != null)) {
                selected = anItem;
                fireContentsChanged(this, -1, -1);
        @Override
        public Object getSelectedItem() {
            return selected;
        @Override
        public void addElement(Object obj) {
            insertElementAt(obj, items.size());
        @Override
        public void removeElement(Object element) {
            removeElementAt(items.indexOf(element));
        @Override
        public void insertElementAt(Object element, int index) {
            items.add(index, element);
            fireIntervalAdded(this, index, index);
        @Override
        public void removeElementAt(int index) {
            Object removed = items.get(index);
            if(selected != null && selected.equals(removed)) {
                Object newSelection;
                int size = items.size();
                if(size == 1) {
                    newSelection = null;
                else {
                    switch(changeOnRemove) {
                    case CLEAR_SELECTION:
                        newSelection = null;
                        break;
                    case SELECT_NEXT:
                        if(index == size - 1) {
                            newSelection = items.get(index - 1);
                        else {
                            newSelection = items.get(index + 1);
                        break;
                    case SELECT_PREVIOUS:
                        if(index == 0) {
                            newSelection = items.get(index + 1);
                        else {
                            newSelection = items.get(index - 1);
                        break;
                    default:
                        assert false : "Unknown SelectionChange: " + changeOnRemove;
                        newSelection = null;
                        break;
                setSelectedItem(newSelection);
            items.remove(index);
            fireIntervalRemoved(removed, index, index);
    }

  • One-to-many relationship - remove item from collection problem

    The ArrayCollection keeps folders tree - subtree of folder is kept in children property and is also ArrayCollection. This collection is fed by 'folders' custom assembler defined like this:
    Assembler works with adding and deleting top level objects of collection.
    Also, when I add new object to children property LCDS issues createItem for new object and then updateItem for children property of parent so everything is fine - new object is persisted and relationship is correct.
    When I remove item from children collection ONLY updateItem on assembler is issued, so object is not deleted from repository. Why this managed reletionship works for adding new object to children collection but doesnt work for deleting?

    Hi;
    A simple way may be create a view on referenced tables:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL>
    SQL> drop table resources;
    Table dropped
    SQL> create table resources(id number, name varchar2(12));
    Table created
    SQL> insert into resources values(1,'Doc....');
    1 row inserted
    SQL> insert into resources values(2,'Img....');
    1 row inserted
    SQL> drop table documents;
    Table dropped
    SQL> create table documents(id number, resource_id number,type varchar2(12));
    Table created
    SQL> insert into documents values(1,1,'txt');
    1 row inserted
    SQL> drop table images;
    Table dropped
    SQL> create table images(id number, resource_id number,path varchar2(24));
    Table created
    SQL> insert into images values(1,2,'/data01/images/img01.jpg');
    1 row inserted
    SQL> create or replace view vw_resource_ref as
      2    select id, resource_id, type, null as path from documents
      3      union
      4     select id, resource_id, null as type, path from images;
    View created
    SQL> select * from resources r inner join vw_resource_ref rv on r.id = rv.resource_id;
            ID NAME                 ID RESOURCE_ID TYPE         PATH
             1 Doc....               1           1 txt         
             2 Img....               1           2              /data01/images/img01.jpg
    SQL> Regards....

  • Remove-Item & Program Files folder: permissions error

    I am attempting to use Remove-Item to delete a file in Program Files and getting a permissions error. But, I am a local admin, and I tried running the script as administrator. I have also tried -Force, to no avail. I hope I don't have to go back to the DOS
    kludge I used in VBScript.
    Any thoughts?
    Gordon

    Well, this is odd. I tried doing it in the ISE, super simple, just Remove-Item and the raw path. Errors. But I verified that the folder in question is set to read only. So in the ISE I added -Force. And it worked.
    So I went back to my code and added -Force back in. And it worked. I assume if I misspelled it or something I would get an error, and I can't imagine the order makes any difference. May be that midnight is just a bit late to be playing in this sandbox.
    EDIT: The plot thickens. I have another folder giving me grief, but this folder actually says in Explorer that I don't have permission to view the folders permissions. this is a lame leftover folder after a (typically incomplete) Windows uninstall. Is there
    perhaps a PowerShell way of taking ownership of a folder like this? In my VBScript version I actually used DOS commands to do the deletes, and they all worked. 
    Thanks!
    Gordon

  • How can we remove items from the VF04 list?

    We have a long list of items in VF04 that, for various reasons (some process related, some due to errors), are not to be billed. We have looked at applying filters to the list but there is nothing really suitable to hide these individual documents e.g. we could filter out some dates where none of the items on that date are to be billed but other dates have a mix of items we want to bill and others we don't.
    I have done a search of this forum but didn't find a previous topic with a quick and simple method to remove items from the list .
    Is there a method, other than billing them or sorting each issue individually, to permanently remove individual documents from the VF04 list?
    Thanks in advance for any help.
    David

    Hi,
    David,
    Download a list of Pending delivers doc form VF04.
    Paste the list in T.Code : VL09 (Delivery reversal) and reverse the delivery.
    Then go to T.Code: VL06G Select the list of deliveries that has been reversed, select/delete all un- wanted deliveries.
    This way you can remove all unwanted pending deliveries forn Billing due list (VF04).
    Thanks & Regards,
    R.Janakiraman

  • Error while adding a item

    Hi All
    When I am adding a item in master data then error occurred "variation for price list and price list for items" and finally i could'nt add item. So please solve it if you have any solution regarding it.
    Thanks with regards
    Bibha
    Edited by: Bibha Singh123 on Mar 25, 2011 12:43 PM

    Hi Bibha,
    check Message 3506-9 Price List Error - Please Help thread.
    Thanks,
    Neetu

  • How can i update/Remove Items from AR Invoice using SDK?

    Hi All,
    I have 1 problem with update or remove item from sales order. here is the source code of mine.
    If inv.GetByKey(DocumentNumber) = True Then
                        inv.CardCode = cardcode
                        Dim ercode As Integer
                        Dim ind As Integer = 1
                        For Each drow As DataGridViewRow In gv.Rows
                            If gv.Rows.Count = ind Then Exit For
                            ercode = drow.Cells("No").Value
                            inv.Lines.SetCurrentLine(ercode)
                            'inv.Lines.ItemCode = drow.Cells("itemcode").Value
                            'inv.Lines.ItemDescription = drow.Cells("itemname").Value
                            inv.Lines.Quantity = drow.Cells("qty").Value
                            inv.Lines.Price = drow.Cells("price").Value
                            ind = ind + 1
                        Next
                        errorcode = inv.Update
                        If errorcode <> 0 Then
                            PublicVariable.oCompany.GetLastError(errorcode, errorsms)
                        Else
                            errorcode = 0
                        End If
                    Else
                        errorsms = "Not found Invoice Document Number"
    End If
    After update, it error "[INV1.Quantity][line:1],'Field cannot be updated (ODBC -1029)'"
    Does anybody know about this?
    Thanks
    TONY

    Hi $riniva$ Rachumallu,
    This is my mistake that not test manually in application.
    Thanks
    TONY

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • Remove Item from Item list through DTW

    Hi Experts,
    Please do the needful for the below issues.
    1.System is not allow partial delivery but  I already activate allow partial delivery at sales order logistic tab.
    2.System is allow to  print the document at client place automatically at the time of the creation of the sales quotation but not at server.
    3.How to remove Item code from the DB with the help of the DTW.

    hi,
    If there is no transactions associated with item,
    Open item in item master data,From menu bar,Select Data ---> Remove.
    for other cases refer Note 1163367 - How can obsolete items be managed in SAP Business One?
    [https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1163367]
    Jeyakanthan

Maybe you are looking for

  • VM Ware Workstation 10 no connection to the PC

      Hello, I installed Virtual Box VM Ware Workstation 10.0.4 with virtual system bulid 9841 Technical Preview posed on Windows 7 Home Premium x64 & 6.1.7601, Service Pack 1 Acer Intel i5 8GB RAM. I have many problems with this  bugs nad need litte hel

  • Booting issue on a new installation on Acer Aspire 4752 laptop.

    Hi All,      I have done a new installation of OS on a Acer laptop stated above.  However, due to some reason, during the booting up process, it will always stuck at screen right before it enter into the logon screen. I will have to press Enter in or

  • How to read values of dynamic UI elements in a backing bean?

    Hi, I have an ADF page where some of the UI elements (in this case, checkboxes) are dynamically rendered as such: <af:forEach var="row" items="#{backing_testPage.userList}"> <af:selectBooleanCheckbox id="checkbox" value="#{row.id}" text="#{row.name}"

  • Install Flash Builder 4.5.x Upgrade without Flex Builder 3.x installed?

    Edit: Is the lack of replies because no one knows the answer or because this was a ridiculously dumb question? Also, if I must have a prior version physically installed to do the upgrade, can I install Flex Builder 3 on a temp Windows machine, upgrad

  • Why does the scroll sometimes not work?

    I know this question has been posted before, but my problem is slightly different. I have synpatics touchpad with my laptop. Sometimes, the touchpad scrolling does not work, but my actual wireless mouse scrolling works. Sometimes my wireless mouse sc