summaryrefslogtreecommitdiff
path: root/navit/iphone/downloader/Classes/RootViewController.m
diff options
context:
space:
mode:
authorgeoghegan <geoghegan@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-08-11 21:55:10 +0000
committergeoghegan <geoghegan@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-08-11 21:55:10 +0000
commit4577d4fb72e8c0386686f8d9fb236c63090e562d (patch)
tree46ffb99452982bbbe85d896997423fa16cae932b /navit/iphone/downloader/Classes/RootViewController.m
parentb502c3c7c1263b5a765d8c9a80bb63f1e19c7668 (diff)
downloadnavit-4577d4fb72e8c0386686f8d9fb236c63090e562d.tar.gz
Moves the location name to the top of the NavBar, when in DownloaderDetailView
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4678 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/iphone/downloader/Classes/RootViewController.m')
-rw-r--r--navit/iphone/downloader/Classes/RootViewController.m22
1 files changed, 16 insertions, 6 deletions
diff --git a/navit/iphone/downloader/Classes/RootViewController.m b/navit/iphone/downloader/Classes/RootViewController.m
index 2be6674f5..d2820fe3c 100644
--- a/navit/iphone/downloader/Classes/RootViewController.m
+++ b/navit/iphone/downloader/Classes/RootViewController.m
@@ -21,8 +21,13 @@
- (void)viewDidLoad {
[super viewDidLoad];
+ // Sets the title of the Navigation bar.
+ self.title= @"Navit Map Downloader";
+
+ // Loads in the array for locations and their associated bounding boxes
NSString *path = [[NSBundle mainBundle] pathForResource:@"LocationsArray" ofType:@"plist"];
locations_ = [[NSMutableArray alloc] initWithContentsOfFile:path];
+
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
@@ -85,6 +90,7 @@
// Configure the cell.
+ // Gets the location name from LocationsArray.plist
cell.textLabel.text = [[self.locations objectAtIndex:indexPath.row] objectForKey:NAME_KEY];
//Makes the fancy arrows to the left of the region being downloaded (e.g. "Ireland > " )
@@ -138,14 +144,18 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-
DownloaderDetailViewController *detailViewController = [[DownloaderDetailViewController alloc] initWithNibName:@"DownloaderDetailViewController" bundle:nil];
- // ...
- // Pass the selected object to the new view controller.
+
+ // Sets the "Back" button in the next ViewController (DownloaderDetailViewController).
+ // Which, be default, pulls the name from the previous ViewController
+ // Here, we manually call it the text label "Back"
+ self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil] autorelease];
+
+ // Pass the selected object to the new view controller.
detailViewController.locationName = [self.locations objectAtIndex:indexPath.row];
- [self.navigationController pushViewController:detailViewController animated:YES];
- [DownloaderDetailViewController release];
-
+ [self.navigationController pushViewController:detailViewController animated:YES];
+
+ [DownloaderDetailViewController release];
}