aboutsummaryrefslogtreecommitdiffstats
path: root/iphone/FixMyStreet/Classes/InputTableViewController.m
diff options
context:
space:
mode:
authormatthew <matthew>2008-12-04 11:12:10 +0000
committermatthew <matthew>2008-12-04 11:12:10 +0000
commit9d6bcd3808eb625690951e047a890df1a65a2a89 (patch)
treeb03106de79ce2186d85acdab7e930fec64a9b05f /iphone/FixMyStreet/Classes/InputTableViewController.m
parent660da129fba269d83d40fe426858a2ba87ca0569 (diff)
Warn if no connection before trying to find location
Diffstat (limited to 'iphone/FixMyStreet/Classes/InputTableViewController.m')
-rw-r--r--iphone/FixMyStreet/Classes/InputTableViewController.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/iphone/FixMyStreet/Classes/InputTableViewController.m b/iphone/FixMyStreet/Classes/InputTableViewController.m
index 3ad127c58..d8819ff2a 100644
--- a/iphone/FixMyStreet/Classes/InputTableViewController.m
+++ b/iphone/FixMyStreet/Classes/InputTableViewController.m
@@ -11,6 +11,7 @@
#import "FixMyStreetAppDelegate.h"
#import "EditSubjectViewController.h"
#import "AboutViewController.h"
+#import "Reachability.h"
@implementation InputTableViewController
@@ -52,7 +53,7 @@
// Let's start trying to find our location...
[MyCLController sharedInstance].delegate = self;
- [[MyCLController sharedInstance] startUpdatingLocation];
+ [self startLocation];
FixMyStreetAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
if (delegate.image) {
@@ -192,7 +193,7 @@
if (indexPath.section == 0) {
[self addPhoto:nil];
} else if (indexPath.section == 2) {
- [[MyCLController sharedInstance].locationManager startUpdatingLocation];
+ [self startLocation];
} else if (indexPath.section == 1) {
FixMyStreetAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
EditSubjectViewController* editSubjectViewController = [[EditSubjectViewController alloc] initWithNibName:@"EditSubjectView" bundle:nil];
@@ -274,7 +275,18 @@
[picker release];
}
-// MyCLControllerDelegate
+// MyCLControllerDelegate and related
+
+-(void)startLocation {
+ NetworkStatus internetConnectionStatus = [[Reachability sharedReachability] internetConnectionStatus];
+ if (internetConnectionStatus == NotReachable) {
+ UIAlertView *v = [[UIAlertView alloc] initWithTitle:@"Location required" message:@"FixMyStreet needs some sort of connection in order to find your location." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ [v show];
+ [v release];
+ } else {
+ [[MyCLController sharedInstance] startUpdatingLocation];
+ }
+}
-(void)newLocationUpdate:(CLLocation *)location {
//UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hey" message:text delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];