App Not Saving Tab Order & "SIGABRT" Error

Discussion in 'iOS Programming' started by kwjohns, Jul 19, 2009.

  1. kwjohns macrumors 6502a

    kwjohns

    Joined:
    Jul 4, 2007
    #1
    I have an app that has more than 5 tabs, therefore I'm implementing code to save the tab order if the user wishes to change it. I have another app that works fine and I'm implementing the same code into the 2nd app but it is throwing fits. It's not saving the tab order and when I debug on the device and exit the application, it doesn't quit the debugger and throws me:

    Here is the code in my app delegate that I believe to be causing this error (when I take it out no SIGABRT error):

    Code:
    - (void)applicationWillTerminate:(UIApplication *)application {
    	
    	NSMutableArray *savedOrder = [NSMutableArray arrayWithCapacity:7];
    	NSArray *tabOrderToSave = tabBarController.viewControllers;
    	for (UIViewController *aViewController in tabOrderToSave) {
    		[savedOrder addObject:aViewController.title];
    	}
    	
    	[[NSUserDefaults standardUserDefaults] setObject:savedOrder forKey:@"savedTabOrder"];
    }
    Like I said, I'm using this same code for another app and it works fine (with the exception of the array capacity being 8 on the other app). :confused:
     
  2. kwjohns thread starter macrumors 6502a

    kwjohns

    Joined:
    Jul 4, 2007
    #2
    Problem has been solved. I didn't have some titles set within Interface Builder that the code was looking for therefore the string was a null value.
     

Share This Page