TableSearch/APLAppDelegate.m

 
/*
 Copyright (C) 2013-2015 Apple Inc. All Rights Reserved.
 See LICENSE.txt for this sample’s licensing information
 
 Abstract:
 The application delegate.
 */
 
#import "APLAppDelegate.h"
 
#import "APLViewController.h"
#import "APLProduct.h"
 
@implementation APLAppDelegate;
 
-(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSArray *productArray = @[[APLProduct productWithType:ProductTypeDevice name:@"iPhone"],
                         [APLProduct productWithType:ProductTypeDevice name:@"iPod"],
                         [APLProduct productWithType:ProductTypeDevice name:@"iPod touch"],
                         [APLProduct productWithType:ProductTypeDevice name:@"iPad"],
                         [APLProduct productWithType:ProductTypeDevice name:@"iPad mini"],
                         [APLProduct productWithType:ProductTypeDesktop name:@"iMac"],
                         [APLProduct productWithType:ProductTypeDesktop name:@"Mac Pro"],
                         [APLProduct productWithType:ProductTypePortable name:@"MacBook Air"],
                         [APLProduct productWithType:ProductTypePortable name:@"MacBook Pro"]];
    
    UINavigationController *navigationController = (UINavigationController *)[self.window rootViewController];
    APLViewController *viewController = [navigationController.viewControllers objectAtIndex:0];
    viewController.products = productArray;
 
    return YES;
}
 
 
 
-(BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder
{
    return YES;
}
 
-(BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder
{
    return YES;
}
 
 
@end