|
@@ -46,7 +46,30 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.title = self.name;
|
|
self.title = self.name;
|
|
|
|
|
+
|
|
|
|
|
+ UIBarButtonItem *returnItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(returnItemClick:)];
|
|
|
|
|
+ self.navigationItem.backBarButtonItem = returnItem;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+- (void)returnItemClick:(UIBarButtonItem *)sender {
|
|
|
|
|
+ if (self.photoCount > 0) {
|
|
|
|
|
+
|
|
|
|
|
+ UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Warning" message:@"There are some photos ready to upload,do you wan to discard them?" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
|
+ UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
+ [weakSelf.navigationController popViewControllerAnimated:YES];
|
|
|
|
|
+ }];
|
|
|
|
|
+ UIAlertAction *noAction = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
|
+
|
|
|
|
|
+ }];
|
|
|
|
|
+ [alert addAction:noAction];
|
|
|
|
|
+ [alert addAction:yesAction];
|
|
|
|
|
+ [self presentViewController:alert animated:YES completion:nil];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ [self.navigationController popViewControllerAnimated:YES];
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
-(void) dealloc
|
|
-(void) dealloc
|
|
|
{
|
|
{
|
|
|
AppDelegate* appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
|
|
AppDelegate* appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
|
|
@@ -611,7 +634,8 @@
|
|
|
}
|
|
}
|
|
|
case RESULT_NET_ERROR:
|
|
case RESULT_NET_ERROR:
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:@"Can not connect to server" title:title controller:weakself];
|
|
|
|
|
|
|
+ [RAUtils message_alert:@"Can not connect to server,and the photos will upload when the network recover" title:title controller:weakself];
|
|
|
|
|
+ [self addTasks];
|
|
|
}
|
|
}
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|