Commit 8dd8b580 authored by Alex Moore's avatar Alex Moore

working on segue unwinds

parent 9812db36
......@@ -50,6 +50,10 @@
}
-(IBAction)unwind:(UIStoryboardSegue *)sender {
//reset UIWebView here
}
/*
#pragma mark - Navigation
......
This diff is collapsed.
......@@ -129,6 +129,10 @@ static int BOOK_ID_LENGTH = 14;
[self.scannedBookTableView reloadData];
}
-(IBAction)unwindFromSettings:(UIStoryboardSegue *)sender {
}
- (void)didReceiveMemoryWarning {
......@@ -195,9 +199,7 @@ static int BOOK_ID_LENGTH = 14;
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
if([segue.destinationViewController isKindOfClass:[SectionViewController class]]) {
// TELL OCI TO END SESSION aka exit out of page
}
}
......
......@@ -163,60 +163,66 @@
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
NSIndexPath *path = [self.tableView indexPathForSelectedRow];
Session *session = [[Session alloc] init];
session.section = [self.sections objectAtIndex:path.row];
ScanBookViewController *destViewController = [segue destinationViewController];
destViewController.session = session;
//need to call AddCollection, then GetSelectedCollections
//AddCollection
NSString *addSelectedPath =
[[NSBundle mainBundle] pathForResource:@"AddCollection"
ofType:@"js"];
NSString *addSelected =
[NSString stringWithContentsOfFile:addSelectedPath
encoding:NSUTF8StringEncoding
error:nil];
[self.webview
stringByEvaluatingJavaScriptFromString:@"var selectedAdd = 49;"];
NSString *add =
[self.webview
stringByEvaluatingJavaScriptFromString:addSelected];
if ([add isEqual:nil]) {
NSLog(@"nil failed");
} else {
NSLog(@"NOT NILL UNFAILED");
}
//GetSelectedCollections
NSString *selectedPath =
[[NSBundle mainBundle] pathForResource:@"GetSelectedCollections"
ofType:@"js"];
NSString *selectedFunc =
[NSString stringWithContentsOfFile:selectedPath
encoding:NSUTF8StringEncoding
error:nil];
NSString *selected =
[self.webview stringByEvaluatingJavaScriptFromString:selectedFunc];
//UIAlertView *selectedAlert =
//[[UIAlertView alloc] initWithTitle:@"Collections Selected"
// message:selected
// delegate:self
// cancelButtonTitle:@"OK"
// otherButtonTitles:nil];
//[selectedAlert show];
//segue to scan
if ([segue.identifier isEqual: @"segueInventoryToScan"]) {
NSIndexPath *path = [self.tableView indexPathForSelectedRow];
Session *session = [[Session alloc] init];
session.section = [self.sections objectAtIndex:path.row];
ScanBookViewController *destViewController = [segue destinationViewController];
destViewController.session = session;
//need to call AddCollection, then GetSelectedCollections
//AddCollection
NSString *addSelectedPath =
[[NSBundle mainBundle] pathForResource:@"AddCollection"
ofType:@"js"];
NSString *addSelected =
[NSString stringWithContentsOfFile:addSelectedPath
encoding:NSUTF8StringEncoding
error:nil];
[self.webview
stringByEvaluatingJavaScriptFromString:@"var selectedAdd = 49;"];
NSString *add =
[self.webview
stringByEvaluatingJavaScriptFromString:addSelected];
if ([add isEqual:nil]) {
NSLog(@"nil failed");
} else {
NSLog(@"NOT NILL UNFAILED");
}
//GetSelectedCollections
NSString *selectedPath =
[[NSBundle mainBundle] pathForResource:@"GetSelectedCollections"
ofType:@"js"];
NSString *selectedFunc =
[NSString stringWithContentsOfFile:selectedPath
encoding:NSUTF8StringEncoding
error:nil];
NSString *selected =
[self.webview stringByEvaluatingJavaScriptFromString:selectedFunc];
//UIAlertView *selectedAlert =
//[[UIAlertView alloc] initWithTitle:@"Collections Selected"
// message:selected
// delegate:self
// cancelButtonTitle:@"OK"
// otherButtonTitles:nil];
//[selectedAlert show];
NSString *saveSetupPath =
[[NSBundle mainBundle] pathForResource:@"SaveSetup" ofType:@"js"];
NSString *saveSetup =
[NSString stringWithContentsOfFile:saveSetupPath
encoding:NSUTF8StringEncoding
error:nil];
encoding:NSUTF8StringEncoding
error:nil];
[self.webview stringByEvaluatingJavaScriptFromString:saveSetup];
} else { //segue back to log-in
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment