UITabBarController setting selected index on launch causing issues

I have 5 tabs and on applicationWillTerminate the currently selected index is archived for use on the next launch. I am having some issues with setting the selected index when the application launches the next time. It seems that if I use the following it works, albeit quite hackishly (it displays tab 1 for a split second then goes to the proper tab):
[self performSelector:@selector(selectSavedTabBarIndex) withObject:nil afterDelay:0.0];
If I do either of the following it works great on the simulator but locks up the device requiring pressing the power button and waiting 10 seconds to close the app. There are no errors/crashlogs of the event when hooked up to a debugger.
[self selectSavedTabBarIndex];
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
[self selectSavedTabBarIndex];
Does anyone have any ideas why this would occur? Could it be an Apple bug?

Maybe i'm not understanding something the problem. The app i'm working on has a tab bar controller, so it was pretty easy for me to select which tab view is shown initially like this:
- (void)applicationDidFinishLaunching:(UIApplication *)application
     self.playNetwork = [[NSUserDefaults standardUserDefaults] stringForKey:@"network_mode_preference"];
     self.user = [[NSUserDefaults standardUserDefaults] stringForKey:@"user"];
     // Create the navigation and view controllers
     [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
     MZAppDelegate *appDelegate = (MZAppDelegate *)[[UIApplication sharedApplication] delegate];
    appDelegate.channelList = [NSMutableArray array];
    appDelegate.contentList = [NSMutableArray array];
     appDelegate.messagesList = [NSMutableArray array];
     UITabBarController *aTabBarController = [[UITabBarController alloc] init];
     firstViewController = [[FirstViewController alloc] init];
     secondViewController = [[SecondViewController alloc] init];
     thirdViewController = [[ThirdViewController alloc] init];
     fourthViewController = [[FourthViewController alloc] init];
     fifthViewController = [[FifthViewController alloc] init];
     aTabBarController.delegate = self;
     self.tabBarController = aTabBarController;
     NSArray *tabViewControllers = [[NSArray alloc] initWithObjects:firstViewController,
                                                                                   secondViewController,
                                                                                   thirdViewController,
                                                                                   fourthViewController,
                                                                                   fifthViewController,
                                                                                   nil];
     [tabBarController setViewControllers: tabViewControllers animated:YES];
     tabBarController.selectedIndex = 4;
     [tabBarController release];
     [tabViewControllers release];
     [firstViewController release];
     [secondViewController release];
     [thirdViewController release];
     [fourthViewController release];
     [fifthViewController release];
     // Configure and show the window
    [window addSubview:[tabBarController view]];
... is this not what you're also trying to do?
Regards,
John
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com

Similar Messages

  • How can i reuse same variables that i create using c:set var="index" /

    hi all,
    please some one helpme!!!!!!
    how can i reuse same variable that i create using
    <c:set var="index" value="${0}"/>
    cause later in the program i use index to do some condition and based on that i increment ...
    so for example if i say...
    <c:if test="${index==0}">
    <c:set var="index" value="${index+1}"/>
    </c:if>
    will it be like
    if(index==0)
    index++;
    can i do like i did be4. if not what do i need to do to reuse. cause i use the variable atleast 5 time and its keep changing on diff condition level.

    Have you tried it?
    It should work, provided you are on the same page.
    The c:set tag creates the variable in pageScope by default.
    If you forward to another JSP you need to set the scope to be "request" so that it is still available.

  • Set Spotlight Indexing Time to Midnight?

    Is there any way to set Spotlight indexing to only work at midnight or some other time?  The amount of indexing that goes on constantly is slowing down my work time and finder access during the day.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Console in the page that opens.
    Step 1
    Select "system.log" from the file list. Enter "mdworker" (without the quotes) in the Filter text field. Post the messages that appear in the Console window — the text, please, not a screenshot.
    If there are runs of repeated messages, post only one example of each. Do not post many repetitions of the same message.
    Some personal information, such as the names of your files, may be included — edit that out, too, but don’t remove the context.
    Step 2
    Do the same with the search string "mds".

  • MDP to HDMI adapter causing issues while connecting Macbook air late 2013 edition to Projector. Projector shows grains on the display.

    MDP to HDMI adapter causing issues while connecting Macbook air late 2013 edition to Projector. Projector shows grains on the display.

    Sounds like you may have been in extended display mode. If so, all you had to do was drag a window to the projector display. Or, if you wanted mirrored mode, in display preferences select check mirror display.

  • How to set Selected Ship-To in BasketUI?

    Hi Experts,
    Can you please help me how (in java code) to "set" the selected ship-to in BasketUI?
    In the code below, at the option, I just need to display the selected="selected" option.
    The output:
    <option  value="1">OPTION_A</option>
    <option  selected="selected" value="2">OPTION_B</option>
    ============================================
    BasketUI ui = new BasketUI(pageContext);
    <select class="select-xlarge" name="headerShipTo" id="headerShipTo" <% if (ui.isAccessible) { %> title="<isa:translate key="b2b.acc.shipto.title"/>" <% } %> >
           <isa:iterate id="shipTo" name="<%= MaintainBasketBaseAction.SC_SHIPTOS %>"    type="com.sap.isa.businessobject.ShipTo">
                       <option <%= ui.getShipToSelected(shipTo) %> value="<%= shipTo.getTechKey() %>">
                                  <%= JspUtil.encodeHtml(shipTo.getShortAddress()) %>
                       </option>
           </isa:iterate>
    </select>
    Thank you very much,
    jemaru

    The method ui.getShipToSelected(Shipto shipto) method checks if the input shipto is the selected Header Shipto
    and returns a string value selected="selected' , and blank string is the current selected shipto is not what is passed to this method.
    Since the BasketUI is, as the name says an UI class, there are no "setters". The UI class actually derives the values from the active basket / order / item objects. So, if you want to set the selected value, you must set this to the actual business object - the order
    Here is what one will do in an Action class to set item ship-to. Use the code below only as an example. You can reuse some of the code in the JSP also.
    //Say, this is what you have from your JSP
    //ship-to selected index
    RequestParser.Parameter shipToCustomer =  requestParser.getParameter("customer[]");
    // Somewhere in the item loop. You are setting the item shipto..
    // Assumed that order object is already available to you..
    ShipTo selectedShipTo = order.getShipTo(new TechKey(shipToCustomer));
    order.getItem(techKey).setShipTo((selectedShipTo == null) ?
                             ShipTo.SHIPTO_INITIAL : selectedShipTo);
    Is this what you are looking for?

  • The default priority setting in Mail is set to "normal"  and is causing emails I send to be sent with red priority flag. How can I set default priority to low = no flag?

    The default priority setting in Mail is set to "normal"  and is causing emails I send to be sent with red priority flag.
    I have found the flags to reduce the priorty level manually to "low Priorty", but how can I set default priority to low = no flag?
    Thank you for advising,

    Try deleting the .plist.
    Quit the application.
    In Finder hold down the option/alt key while selecting the Go menu item. Select Library. Then go to Preferences/com.apple.mail.plist. Move the .plist to your desktop.
    Open the application and test. If it works okay, delete the plist from the desktop. 
    If the application is the same, return the .plist to where you got it from, overwriting the newer ones.
    If you want to make your user library permanently visible, run the below command in Applications/Terminal.
    chflags nohidden ~/Library/
    You will need to do that after any updates.

  • Deployment Rule Sets do not properly launch the latest available version from the JRE6 family when the jpi-version is specified by the RIA

    Issue Summary
    In Java 1.7 Update 71, Java 1.7 Update 72 and Java 1.8 Update 25 Deployment Rule Sets do not properly launch the latest available version from the JRE6 family when the jpi-version is specified by the RIA.  We've noticed this with Oracle Forms and Reports 11g where we have forms that specify Java 1.6 Update 20.  We used to be able to specify Java 1.6 Update 26 in our Ruleset, but now the only version a that works in our ruleset is Java 1.6 Update 20 which is the same version requested by the JPI-Version attribute of the jar.  The long term solution would be to upgrade Oracle Forms and Reports, however this isn't currently in the cards.
    RuleSet.xml Test
    Ruleset.xml

    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    &lt;ruleset version=&quot;1.0+&quot;&gt;  
    &lt;rule&gt;
       &lt;id location=&quot;*.javatester.org&quot; /&gt;
       &lt;action permission=&quot;run&quot; version=&quot;1.6*&quot; /&gt;
    &lt;/rule&gt;
    &lt;ruleset version=&quot;1.0+&quot;&gt;
    &lt;rule&gt;
       &lt;id location=&quot;*.internaldomain.name&quot; /&gt;
       &lt;action permission=&quot;run&quot; version=&quot;1.6*&quot; /&gt;
    &lt;/rule&gt;
    &lt;/ruleset&gt;
    Test 1 (Control)
    Installed Java Versions:
    – 1.7 Update 51 b13 (both x86 and x64 however x86 is invoked)
    – 1.6 Update 26 b03 (both x86 and x64 however x86 is invoked)
    Deployment Ruleset works as expected for both URLs
    Test 2
    Installed Java Versions:
    – 1.7 Update 72 (both x86 and x64 however x86 is invoked)
    – 1.6 Update 26 b03 (both x86 and x64 however x86 is invoked)
    The RuleSet works for JavaTester.org however on internaldomain.name we get the following error:
    With the trace logging turned on, I suspected the version attribute supplied by the RIA. I was able to trick Java by adding the following to my system deployment.properties file:
    deployment.javaws.jre.0.product=1.6.0_20
    deployment.javaws.jre.0.path=C\:\\Program Files (x86)\\Java\\jre6\\bin\\javaw.exe
    deployment.javaws.jre.0.enabled=true
    Because the RIA requests 1.6.0_20 it matches 1.6* from the deployment ruleset sooner than 1.6.0_26. However, if 1.6.0_20 is not available 1.6.0_26 should match according to the Deployment Rule Set documentation:
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/deployment_rules.html
    The version of the JRE that is used is determined by the following order of precedence:
    1. The current version of the JRE is used if it is available and matches both the version attribute and the version requested by the RIA.
    2. The latest available version of the JRE is used if it matches both the version attribute and the version requested by the RIA.
    3. The current version of the JRE is used if it is available and matches the version attribute.
    4. The latest available version of the JRE is used if it matches the version attribute.
    If no version is available that meets the criteria, then the RIA is blocked, and a message is shown to the user. To provide a custom message, include the message element.
    As a result:
    If Java 1.6.0_20 is listed in the version requested by the RIA and 1.6.0_20 is listed in the deployment.properties file, #1 matches.
    If Java 1.6.0_20 is listed in the version requested by the RIA, but 1.6.0_20 is NOT listed in the deployment.properties file the #1 SHOULD match, but doesn’t. It used to match up-to and including JRE 1.7 Update 51 however the ruleset appears to no longer match in subsequent versions.
    #2 should never match with our current Deployment Ruleset. It would match if we specified 1.7* as a version in the Ruleset.xml.
    #3 used to be broken as well after JRE 1.7 Update 51 however this bug has been marked as fixed. See: http://bugs.java.com/view_bug.do?bug_id=8032781
    I have reproduced this issue with Java 1.7 Update 71, Java 1.7 Update 72, and Java 1.8 Update 25 when one of these versions are installed with Java 1.6 Update 26.

    I can't seem to edit this post anymore, for some odd reason.
    So here goes;
    I found this post in NVIDIA's knowledge base;
    When installing an after-market graphics card into a certified Windows 8 PC with UEFI enabled, the s...
    The interesting parts in this post are as follows;
    When an after-market graphics card is installed into a motherboard with UEFI enabled in the system BIOS, or if the system is a certified Windows 8 PC with Secure Boot enabled, the system may not boot.
    UEFI is a new system BIOS feature that is provided on most new motherboards. A UEFI system BIOS is required in order for the Windows 8 Secure Boot feature to work. Secure boot is enabled by default on certified Windows 8 PCs.
    In order to get the PC to boot with a graphics card that does not contain UEFI firmware, the end-user must first disable the secure boot feature in the system's SBIOS before installing the graphics card.
    Note: Some system SBIOS's incorporate a feature called compatibility boot. These systems will detect a non-UEFI-enabled firmware VBIOS and allow the user to disable secure boot and then proceed with a compatibility boot. If the system contains a system SBIOS the supports compatibility boot, the user will need to disable secure boot when asked during boot process
    This leads me to believe that the BIOS update that wrecked my setup was 9SKT58A/9SJT58A, which only contains one change;
    "Adds support for updating BIOS from a WIN7 BIOS to a WIN8 BIOS".
    I've just ordered a cheap UEFI-compatible GT640 from Gainward, so I hope I'll be able to try that out this weekend.

  • Getting the selected index of a table (CL_WD_TABLE) without lead-selection

    Hi
    When I click in a table-UI (not alv-table) on a f4-help, I can search with se11-searchhelp on a field. After I choose something, I should also fill some other fields in the same row.
    In the table I have no lead-selection. So, I am searching for a method that gets me the selected index. The element-class for the table-UI is CL_WD_TABLE.
    Once I have the selected index, I could change the fields in the same row inside the WDDOMODIFYVIEW.
    With activated node-selection it can be, that the user selects one row, but he starts the f4-help on another row (the lead-selection doesn't change).
    I have seen this article, but i hope that for the table-UI it is different than with alv:
    [ON_CELL_ACTION triggered only by ENTER ?]

    Hi Lorenzo,
    I'm trying to do the same thing and came up with this solution. In WDDOMODIFYVIEW, since we cannot know in which table row the user clicked the search help, I simply loop through all the rows of the table. For each row, I delegate to a method in the Component Controller which sets the specified index as the table's lead selection then reads the selected table row from the context. I can then populate fields in the selected row as needed.
    METHOD wddomodifyview .
       DATA lo_componentcontroller TYPE REF TO ig_componentcontroller.
       DATA lo_nd_items TYPE REF TO if_wd_context_node.
       DATA lt_items TYPE wd_this->elements_items.
    * -- Upon return from the search help, populate table row details
       lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).
       lo_nd_items = wd_context->get_child_node( name = wd_this->wdctx_items ).
       lo_nd_items->get_static_attributes_table( IMPORTING table = lt_items ).
    * Since we cannot know in which table row the user requested the search help,
    * loop through all table rows, populating table row details as needed.
       DESCRIBE TABLE lt_items LINES sy-tfill.
       DO sy-tfill TIMES.
    *   Delegate to the Component Controller
         lo_componentcontroller->get_table_row_detail( sy-index ).
       ENDDO.
    ENDMETHOD.

  • Explorer InfoSpaces on HANA Views - column label changes cause issues?

    Key question is – do simply label changes in HANA view cause issues with Explorer InfoSpaces?  Furthermore, on source view changes, does the InfoSpace also need to be adjusted?
    What we have observed is this
    1. InfoSpaces have been created using the “SAP HANA appliance” connection highlighted below. The corresponding “Home” screen is shown below that, so there are around 14 or so InfoSpaces that should be available.
    2. Yesterday, there was a production deployment that contained some changes to the underlying views in the form of label changes (not column name changes).
    3. Now, in the “Manage” screen we cannot see these same 14 InfoSpaces available under the expected connection. Instead, they are all available under the “Source Unavailable” node with the default action of “Change Source” shown.
    Additionally, we are seeing some strange behavior where certain facets are actually containing the wrong data. For example, in a facet/column called “Source Type”, where the expected values are “NBP or PBP”, we are seeing Material numbers like “00001112453”. This leads me to believe that there is a mapping issue under the covers.
    Thanks,
    Justin

    Our BOE Explorer is Version: 14.1.1 Build: 1072   - I’m not sure how this corresponds with your 69.01 to 74 numbers (release note numbers?).
    But it sounds identical to your description.
    One of our observations: if we change the sorting on a facet pane using the upper right sort control the values are corrected for a while, at least until we change a measure and the set of facets get updated with the miss-mapped values again.    This only occurs on some models and we haven’t been able to determine what the underlying criteria might be that aggravates the problem. 
    Thanks for your input – it helps us determine a viable path forward.
    Cheers,
    Tony

  • Itunes bombs outs when selecting "store"  with UBD.exe issue

    Itunes bombs outs when selecting "store"  with UBD.exe issue - what is the remedy?

    Hello there, tuneasa.
    The following Knowledge Base article offers some great steps for troubleshooting issues with iTunes performance:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Set dropdown indexes?

    Can i. like i do in html, set the indexes of a selectbox manually?
    <select>
         <option value="1">Foo</option>
         <option value="2">Bar</option>
    </select>
    What i do now is to set the index first and pregmatch it like:
    .add('item', '1. Foo');
    .add('item', '2. Bar');
    But its not very nice.
    From what i can tell index is protected. Is there a way around it?
    /Pontus

    Hey!
    Yeah, It's typical HTML stuff. You can't do it in InDesign.
    You can retrieve index number from selected item like this:
    var myList = ["Item 1","Item 2","Item 3","Item 4"];
    var myWin = new Window('dialog', 'Test Dropdown');
    var myDrop = myWin.add('dropdownlist', undefined, myList);
    // get values
    myDropIndex = myDrop.selection.index;
    myDropValue = myDrop.selection;
    Or, you can create two dimensional array, pust first values into dropdown, and depending on selection.index, you retrieve desired value.
    Hope it helps!
    tomaxxi
    http://indisnip.wordpress.com/

  • I am very annoyed at the Creative Cloud set up and the non-stop issues and problems

    I am very annoyed at the Creative Cloud set up and the non-stop issues and problems!  I am paying monthly for this service and it is constantly failing in some way!  So far in three months I have had to uninstall and re-install Photoshop THREE times because it stopped working properly and Illustrator I have had to do that same to TWICE!  That isn't including the other apps that have had issues!  I don't have the time to constantly be un-installing and re-installing all or some of the Creative Cloud because your developers are not making a product that works consistently for the money you are charging!  It is costing me more than just this monthly fee!  And I am even less impressed with the fact that I cannot email someone for assistance in resolving these issues.  Really Adobe?

    Adobe contact information - http://helpx.adobe.com/contact.html may help

  • Can too large a folder cause issues and effect performace of my Mac Pro

    Hi, I have a 180 gb folder filled with important data within my Home folder. This folder has a many subfolders as well. The folder is on my startup drive and where I have Snow Leopard installed. Can too large a folder cause issues with my mac and effect performance? Thanks

    another way to ask, would you make better use of, and improve I/O and performance, if you used your other drive bays? yes.
    Boot drives with even less than 50% free is probably not a good idea. All depends on whether 200GB is on 1TB or on 500GB drive. And how fragmented free space even.
    Lifting, loading and writing or copying 4GB files of course does have an impact, so if you work with 2GB files in CS5....
    Having a dedicated type boot drive, media drive (and isolate media and library files) as well as scratch drive is normally done with Mac Pro.
    The biggest bang in performance: lean mean SSD boot drive.

  • How do I set cursor.index to anywhere in the graph array?

    I am using LV 8.5.1 and feeding an XY graph with an X-Y array of data. Only a section of the array is displayed on the graph. I have a cursor (single-plot).
    I would like to set Cursor.Index property node of the cursor associated with the plot to the maximum index value of the graphed array regardless of the XScale range. I don't seem to be able to do it. I cannot set it beyond a certain number. When I rescale the graph I have a new maximum number. Is this what should happen?
    To get around this, I am momentarily setting the XScale.ScaleFit property to 1, which then allows me to set Cursor.Index to maximum (I then immediately reduce my scale range appropriately). I am having to do this before every occurrence of setting the Cursor.Index in case the new setting exceeds the currently allowed maximum value. Just seems a bit clunky.
    Thanks for any help.

    This is no longer a problem. My data is too big to feasibly be fed into a graph so am having to chop it up and use my own index pointer.

  • How to get the previous row selected index of a table....

    Hi friends,
    I have a table. i have a action/event handler defined on its onLeadSelect event.
    In this event, if i use node_code->get_lead_selection_index( ) .. i m getting the newly clicked row index.
    ex: table has 3 rows.
    Row 1 is by default selected. Now if i select the row 3, in my event by using node_code->get_lead_selection_index( ). im getting index 3. which i sel
    But i want to get index 1. 
    kindly help me.. i dont have any other option as i m very new to this.
    hope i gave u correct inputs on my problem.
    thanks in advance,
    Niraja

    One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
    On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
    There could be other ways to achieve this. This is one of the methods.
    Best Regards,
    Rashmi.

Maybe you are looking for

  • Sort Order of Contacts

    Hi, can someone help with this please.. On my Z10, the contacts order seems to make no sense. Here is an example of the order (with correct case present) alison williams Alison Berry Alison Maughan Alison Newton Alison Watson Alison Williams As you c

  • Export xmp from jpeg

    Hi, Photographer I use Internet in lots of coutries. I have to work in jpeg and i want to export XML to send by Internet. So Can I export XML from JPEG ? Can I see the modifications if I put the sidecars XML in the directory of jpeg without modificat

  • Officejet 8600 wont print

    I have two laptops connected wirelessly to my Officejet 8600, and it's worked just fine for months.  Now, neither of my computers recognize the printer when I try to print.  When I go in to devices in both, they show the printer as being the default.

  • Please explain to me!!

    Hi, I have 2 big question on JSF. First is how to resolve this issue: http://forum.java.sun.com/thread.jspa?forumID=427&threadID=791340 I can't put all in session... Then I just had another problem: I used setPropertyActionListener in a command link

  • Errors in table

    Hello, i have two tables with drag and drop. Table of droptarget have a field where conditions are evaluated when modify a value, therefore, the listener if the conditions add an error to the column component. the problem is that when i get to frag a