2011-06-24 15:57:30 +00:00
|
|
|
#import "AppDelegate_iPhone.h"
|
|
|
|
|
|
|
|
@implementation AppDelegate_iPhone
|
|
|
|
@synthesize window, fRoot, fDetail;
|
|
|
|
|
2011-07-07 19:26:42 +00:00
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
2011-06-24 15:57:30 +00:00
|
|
|
[window addSubview:fDetail.view];
|
2011-07-07 19:26:42 +00:00
|
|
|
[window addSubview:fRoot.view];
|
2011-06-24 15:57:30 +00:00
|
|
|
[fRoot loadData];
|
|
|
|
fDetail.view.hidden = YES;
|
|
|
|
[window makeKeyAndVisible];
|
2011-07-07 19:26:42 +00:00
|
|
|
|
2011-06-24 15:57:30 +00:00
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2011-07-07 19:26:42 +00:00
|
|
|
- (void)dealloc {
|
|
|
|
[window release];
|
|
|
|
[fRoot release];
|
|
|
|
[fDetail release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
2011-06-24 15:57:30 +00:00
|
|
|
|
2011-07-07 19:26:42 +00:00
|
|
|
//Table View Delegate Methods
|
2011-06-24 15:57:30 +00:00
|
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
[fDetail goToItem:indexPath.row];
|
|
|
|
[UIView transitionWithView:window
|
|
|
|
duration:0.5
|
|
|
|
options:UIViewAnimationOptionTransitionFlipFromRight
|
2011-07-07 19:26:42 +00:00
|
|
|
animations:^{
|
2011-06-24 15:57:30 +00:00
|
|
|
fRoot.view.hidden = YES;
|
|
|
|
fDetail.view.hidden = NO;
|
|
|
|
}
|
|
|
|
completion:NULL];
|
|
|
|
}
|
|
|
|
|
2011-07-07 19:26:42 +00:00
|
|
|
- (IBAction)displaySampleList:(id)sender {
|
2011-06-24 15:57:30 +00:00
|
|
|
[UIView transitionWithView:window
|
|
|
|
duration:0.5
|
|
|
|
options:UIViewAnimationOptionTransitionFlipFromLeft
|
2011-07-07 19:26:42 +00:00
|
|
|
animations:^{
|
2011-06-24 15:57:30 +00:00
|
|
|
fRoot.view.hidden = NO;
|
|
|
|
fDetail.view.hidden = YES;
|
|
|
|
}
|
|
|
|
completion:NULL];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|