diff options
author | geoghegan <geoghegan@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-08-11 21:55:10 +0000 |
---|---|---|
committer | geoghegan <geoghegan@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-08-11 21:55:10 +0000 |
commit | 4577d4fb72e8c0386686f8d9fb236c63090e562d (patch) | |
tree | 46ffb99452982bbbe85d896997423fa16cae932b /navit/iphone/downloader | |
parent | b502c3c7c1263b5a765d8c9a80bb63f1e19c7668 (diff) | |
download | navit-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')
4 files changed, 36 insertions, 91 deletions
diff --git a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h index d1a1acc93..a7238e8ed 100644 --- a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h +++ b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h @@ -12,12 +12,11 @@ @interface DownloaderDetailViewController : UIViewController { @private - UITextField *nameTextField_; NSDictionary *locationName_; + } -@property (nonatomic, retain) IBOutlet UITextField *nameTextField; @property(nonatomic, retain) NSDictionary *locationName; @end diff --git a/navit/iphone/downloader/Classes/DownloaderDetailViewController.m b/navit/iphone/downloader/Classes/DownloaderDetailViewController.m index 367290699..97e24b1c4 100644 --- a/navit/iphone/downloader/Classes/DownloaderDetailViewController.m +++ b/navit/iphone/downloader/Classes/DownloaderDetailViewController.m @@ -11,7 +11,8 @@ @implementation DownloaderDetailViewController -@synthesize nameTextField=nameTextField_, locationName=locationName_; +@synthesize locationName=locationName_; + // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. /* @@ -24,12 +25,16 @@ } */ -/* + // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { - [super viewDidLoad]; + + // Sets the Navigation bar to have the location name + self.title = [self.locationName objectForKey:NAME_KEY]; + + [super viewDidLoad]; } -*/ + /* // Override to allow orientations other than the default portrait orientation. @@ -54,12 +59,9 @@ -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - // Set up our UI with the provided drink - self.nameTextField.text = [self.locationName objectForKey:NAME_KEY]; } - (void)dealloc { - [nameTextField_ release]; [locationName_ release]; [super dealloc]; } diff --git a/navit/iphone/downloader/Classes/DownloaderDetailViewController.xib b/navit/iphone/downloader/Classes/DownloaderDetailViewController.xib index 26842f478..da3a7c836 100644 --- a/navit/iphone/downloader/Classes/DownloaderDetailViewController.xib +++ b/navit/iphone/downloader/Classes/DownloaderDetailViewController.xib @@ -45,7 +45,7 @@ <object class="IBUIButton" id="433218619"> <reference key="NSNextResponder" ref="191373211"/> <int key="NSvFlags">292</int> - <string key="NSFrame">{{20, 337}, {280, 59}}</string> + <string key="NSFrame">{{20, 20}, {280, 59}}</string> <reference key="NSSuperview" ref="191373211"/> <bool key="IBUIOpaque">NO</bool> <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> @@ -71,45 +71,15 @@ <bytes key="NSWhite">MC41AA</bytes> </object> </object> - <object class="IBUITextField" id="599116497"> - <reference key="NSNextResponder" ref="191373211"/> - <int key="NSvFlags">292</int> - <string key="NSFrameSize">{320, 31}</string> - <reference key="NSSuperview" ref="191373211"/> - <bool key="IBUIOpaque">NO</bool> - <bool key="IBUIClipsSubviews">YES</bool> - <bool key="IBUIUserInteractionEnabled">NO</bool> - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> - <int key="IBUIContentVerticalAlignment">0</int> - <string key="IBUIText"/> - <int key="IBUIBorderStyle">3</int> - <string key="IBUIPlaceholder">Name</string> - <object class="NSColor" key="IBUITextColor"> - <int key="NSColorSpace">3</int> - <bytes key="NSWhite">MAA</bytes> - <object class="NSColorSpace" key="NSCustomColorSpace" id="993274860"> - <int key="NSID">2</int> - </object> - </object> - <object class="NSFont" key="IBUIFont"> - <string key="NSName">Helvetica</string> - <double key="NSSize">18</double> - <int key="NSfFlags">16</int> - </object> - <int key="IBUITextAlignment">1</int> - <bool key="IBUIAdjustsFontSizeToFit">YES</bool> - <float key="IBUIMinimumFontSize">17</float> - <object class="IBUITextInputTraits" key="IBUITextInputTraits"> - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> - </object> - </object> </object> <string key="NSFrameSize">{320, 416}</string> <reference key="NSSuperview"/> <object class="NSColor" key="IBUIBackgroundColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MQA</bytes> - <reference key="NSCustomColorSpace" ref="993274860"/> + <object class="NSColorSpace" key="NSCustomColorSpace"> + <int key="NSID">2</int> + </object> </object> <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics"> @@ -129,14 +99,6 @@ </object> <int key="connectionID">3</int> </object> - <object class="IBConnectionRecord"> - <object class="IBCocoaTouchOutletConnection" key="connection"> - <string key="label">nameTextField</string> - <reference key="source" ref="372490531"/> - <reference key="destination" ref="599116497"/> - </object> - <int key="connectionID">11</int> - </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -152,7 +114,6 @@ <reference key="object" ref="191373211"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> - <reference ref="599116497"/> <reference ref="433218619"/> </object> <reference key="parent" ref="0"/> @@ -173,11 +134,6 @@ <reference key="object" ref="433218619"/> <reference key="parent" ref="191373211"/> </object> - <object class="IBObjectRecord"> - <int key="objectID">8</int> - <reference key="object" ref="599116497"/> - <reference key="parent" ref="191373211"/> - </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -190,8 +146,6 @@ <string>1.IBPluginDependency</string> <string>7.IBPluginDependency</string> <string>7.IBViewBoundsToFrameTransform</string> - <string>8.IBPluginDependency</string> - <string>8.IBViewBoundsToFrameTransform</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -201,11 +155,7 @@ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> <object class="NSAffineTransform"> - <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwsAAAA</bytes> - </object> - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> - <object class="NSAffineTransform"> - <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAwegAAA</bytes> + <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw08AAA</bytes> </object> </object> </object> @@ -225,7 +175,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">11</int> + <int key="maxID">13</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -233,17 +183,6 @@ <object class="IBPartialClassDescription"> <string key="className">DownloaderDetailViewController</string> <string key="superclassName">UIViewController</string> - <object class="NSMutableDictionary" key="outlets"> - <string key="NS.key.0">nameTextField</string> - <string key="NS.object.0">UITextField</string> - </object> - <object class="NSMutableDictionary" key="toOneOutletInfosByName"> - <string key="NS.key.0">nameTextField</string> - <object class="IBToOneOutletInfo" key="NS.object.0"> - <string key="name">nameTextField</string> - <string key="candidateClassName">UITextField</string> - </object> - </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">Classes/DownloaderDetailViewController.h</string> @@ -381,14 +320,6 @@ </object> </object> <object class="IBPartialClassDescription"> - <string key="className">UITextField</string> - <string key="superclassName">UIControl</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="561062176"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">UIKit.framework/Headers/UITextField.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> <string key="className">UIView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> @@ -397,7 +328,10 @@ </object> <object class="IBPartialClassDescription"> <string key="className">UIView</string> - <reference key="sourceIdentifier" ref="561062176"/> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBFrameworkSource</string> + <string key="minorKey">UIKit.framework/Headers/UITextField.h</string> + </object> </object> <object class="IBPartialClassDescription"> <string key="className">UIView</string> 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]; } |