diff --git a/DUREX Vendor Control/CommunicationProtocol.m b/DUREX Vendor Control/CommunicationProtocol.m
index 3781449..5d08152 100644
--- a/DUREX Vendor Control/CommunicationProtocol.m
+++ b/DUREX Vendor Control/CommunicationProtocol.m
@@ -53,7 +53,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
numPackets = 0;
}];
if(numPackets)
@@ -66,7 +66,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
numBytes = 0;
}];
if(numBytes)
@@ -77,7 +77,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
}];
}
}
@@ -89,7 +89,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
}
];
return message;
@@ -106,7 +106,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
status = FALSE;
}
];
@@ -135,7 +135,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
status = FALSE;
}
];
@@ -149,7 +149,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
status = FALSE;
}
];
@@ -161,7 +161,7 @@
}
onFail:^(NSError *error)
{
- NSLog(@"%@",error);
+ NSLog(@"[CommunicationProtocol.m]: %@",error);
status = FALSE;
}
];
diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
index f90dfa4..1dee694 100644
--- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
+++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
@@ -272,7 +272,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = EM;
- LastUpgradeCheck = 0500;
+ LastUpgradeCheck = 0510;
ORGANIZATIONNAME = Emmoco;
TargetAttributes = {
3471867718070D9300FA0FB2 = {
@@ -369,7 +369,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -409,7 +408,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -442,7 +440,6 @@
3471868A18070D9300FA0FB2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -461,7 +458,6 @@
3471868B18070D9300FA0FB2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -480,7 +476,6 @@
3471868D18070D9300FA0FB2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
@@ -503,7 +498,6 @@
3471868E18070D9300FA0FB2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
index 3909138..78612f5 100644
--- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
diff --git a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 0c56aef..fe2b454 100644
--- a/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -2,68 +2,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DUREX Vendor Control/MenuTableViewController.h b/DUREX Vendor Control/MenuTableViewController.h
index 98c31da..91acfdf 100644
--- a/DUREX Vendor Control/MenuTableViewController.h
+++ b/DUREX Vendor Control/MenuTableViewController.h
@@ -36,4 +36,6 @@ enum {
@property (strong,nonatomic) Stack *parentLayout;
+- (void) navBack;
+
@end
diff --git a/DUREX Vendor Control/MenuTableViewController.m b/DUREX Vendor Control/MenuTableViewController.m
index 6001180..d8c348f 100644
--- a/DUREX Vendor Control/MenuTableViewController.m
+++ b/DUREX Vendor Control/MenuTableViewController.m
@@ -71,9 +71,12 @@
[self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]];
}
-- (void) changeNavLevel: (uint8_t) level
+- (void) changeNavLevel: (uint8_t) level : (BOOL) push
{
- [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]];
+ if(push)
+ {
+ [[self parentLayout] push: [NSNumber numberWithUnsignedChar:self.currentNavLevel]];
+ }
[self setCurrentNavLevel:level];
[self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]];
if([self currentNavLevel] == MAINTENANCE)
@@ -95,6 +98,13 @@
[[self tableView] reloadSections:sections withRowAnimation:UITableViewRowAnimationAutomatic];
}
+- (void) navBack
+{
+ NSNumber *prevLevel = [[self parentLayout] pop];
+ self.currentNavLevel = prevLevel.intValue;
+ [self changeNavLevel: prevLevel.intValue : FALSE];
+}
+
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
NSString *title = @"";
@@ -136,7 +146,13 @@
//Set navigation level
[self initializeMenuEntries];
- [self changeNavLevel:MENU];
+ self.currentNavLevel = 255;
+ [self changeNavLevel:MENU:FALSE];
+ /*
+ DUREXAppDelegate *appDelegate = (DUREXAppDelegate *)[[UIApplication sharedApplication] delegate];
+ CustomNavigationController *navController = [appDelegate navController];
+ navController.auxController = self;
+ */
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
@@ -198,8 +214,9 @@
NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text];
if([cellName isEqualToString:@"Maintenance"])
{
- NSLog(@"Changing to navLevel: MAINTENANCE");
- [self changeNavLevel:MAINTENANCE];
+ NSLog(@"[MenuTableViewController.m]: Changing to navLevel: MAINTENANCE");
+
+ [self changeNavLevel:MAINTENANCE:TRUE];
}
}
@@ -217,15 +234,15 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
- NSLog(@"navLevel is %d",[self currentNavLevel]);
+ NSLog(@"[MenuTableViewController.m]: navLevel is %d",[self currentNavLevel]);
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self currentCellIdentifier] forIndexPath:indexPath];
if (cell == nil)
{
- NSLog(@"Initializing cell");
+ NSLog(@"[MenuTableViewController.m]: Initializing cell");
if([self currentNavLevel] == MAINTENANCE)
{
- NSLog(@"Dispatching Maintenance-type cell");
+ NSLog(@"[MenuTableViewController.m]: Dispatching Maintenance-type cell");
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:[self currentCellIdentifier]];
}
else
@@ -244,7 +261,7 @@
[[cell textLabel] setText:[[self currentElements] objectAtIndex:[indexPath row]+offset]];
if([self currentNavLevel] == MAINTENANCE)
{
- NSLog(@"Customizing cell for navLevel MAINTENANCE");
+ NSLog(@"[MenuTableViewController.m]: Customizing cell for navLevel MAINTENANCE");
[[cell detailTextLabel] setText:@"VALUE"];
[cell setAccessoryView: [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_checkmark"]]];
if( [[[cell textLabel] text] isEqualToString:@"5€ Notes"])
diff --git a/DUREX Vendor Control/Stack.m b/DUREX Vendor Control/Stack.m
index 0a40b75..9e4aa88 100644
--- a/DUREX Vendor Control/Stack.m
+++ b/DUREX Vendor Control/Stack.m
@@ -27,7 +27,6 @@
- (void) push: (id) element
{
[[self dataArray] addObject:element];
- printf("%ld elements in array\n",(long)[self count]);
}
- (id) pop
{
@@ -42,7 +41,7 @@
}
- (void) clear
{
-
+ [[self dataArray] removeAllObjects];
}
@end
diff --git a/DUREX tests/CustomNavigationController.h b/DUREX tests/CustomNavigationController.h
new file mode 100644
index 0000000..766914d
--- /dev/null
+++ b/DUREX tests/CustomNavigationController.h
@@ -0,0 +1,16 @@
+//
+// CustomNavigationController.h
+// DUREX test
+//
+// Created by Imanol Barba on 8/7/14.
+// Copyright (c) 2014 Emmoco. All rights reserved.
+//
+
+#import
+#import "MenuTableViewController.h"
+
+@interface CustomNavigationController : UINavigationController
+
+@property (strong,nonatomic) MenuTableViewController *auxController;
+
+@end
diff --git a/DUREX tests/CustomNavigationController.m b/DUREX tests/CustomNavigationController.m
new file mode 100644
index 0000000..b1d7ce9
--- /dev/null
+++ b/DUREX tests/CustomNavigationController.m
@@ -0,0 +1,79 @@
+//
+// CustomNavigationController.m
+// DUREX test
+//
+// Created by Imanol Barba on 8/7/14.
+// Copyright (c) 2014 Emmoco. All rights reserved.
+//
+
+#import "CustomNavigationController.h"
+
+@interface CustomNavigationController ()
+
+@end
+
+@implementation CustomNavigationController
+
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization
+ }
+ return self;
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+- (UIViewController *)popViewControllerAnimated:(BOOL)animated
+{
+ if(self.auxController == nil)
+ {
+ NSLog(@"[CustomNavigationController.m]: WARNING: No Auxiliar Controller assigned to Navigation controller");
+ return [super popViewControllerAnimated:animated];
+ }
+ else
+ {
+ NSLog(@"[CustomNavigationController.m]: Navigation Stack has %d remaining levels",[[[self auxController] parentLayout] count]);
+ if([[[self auxController] parentLayout] count] > 0)
+ {
+ NSLog(@"[CustomNavigationController.m]: Falling to previous navigation level");
+ [[self auxController] navBack];
+ }
+ else
+ {
+ NSLog(@"[CustomNavigationController.m]: No more navigation levels in stack, falling to previous view");
+ self.auxController = nil;
+ return [super popViewControllerAnimated:animated];
+ }
+ }
+ return nil;
+}
+
+/*- (void) setAuxController:(MenuTableViewController *)controller
+{
+ self.auxController = controller;
+}*/
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
+{
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+}
+*/
+
+@end
diff --git a/DUREX tests/DUREX test.xcodeproj/project.pbxproj b/DUREX tests/DUREX test.xcodeproj/project.pbxproj
index b605964..cd401e6 100644
--- a/DUREX tests/DUREX test.xcodeproj/project.pbxproj
+++ b/DUREX tests/DUREX test.xcodeproj/project.pbxproj
@@ -22,6 +22,7 @@
F9469169193015EE006DACD3 /* icon_checkmark.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469167193015EE006DACD3 /* icon_checkmark.png */; };
F946916A193015EE006DACD3 /* icon_delete.png in Resources */ = {isa = PBXBuildFile; fileRef = F9469168193015EE006DACD3 /* icon_delete.png */; };
F962A233192FCA8A00E4324A /* Stack.m in Sources */ = {isa = PBXBuildFile; fileRef = F962A232192FCA8A00E4324A /* Stack.m */; };
+ F97A7D701992DF1A0028036D /* CustomNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */; };
F98356D6192E835F00EA6821 /* InitialViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356D5192E835F00EA6821 /* InitialViewController.m */; };
F98356D8192E906600EA6821 /* bluetooth.png in Resources */ = {isa = PBXBuildFile; fileRef = F98356D7192E906600EA6821 /* bluetooth.png */; };
F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = F98356DA192EAFD400EA6821 /* CommunicationProtocol.m */; };
@@ -61,6 +62,8 @@
F9469168193015EE006DACD3 /* icon_delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon_delete.png; sourceTree = SOURCE_ROOT; };
F962A231192FCA8A00E4324A /* Stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stack.h; sourceTree = SOURCE_ROOT; };
F962A232192FCA8A00E4324A /* Stack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Stack.m; sourceTree = SOURCE_ROOT; };
+ F97A7D6E1992DF1A0028036D /* CustomNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomNavigationController.h; sourceTree = SOURCE_ROOT; };
+ F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomNavigationController.m; sourceTree = SOURCE_ROOT; };
F98356D4192E835F00EA6821 /* InitialViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitialViewController.h; sourceTree = SOURCE_ROOT; };
F98356D5192E835F00EA6821 /* InitialViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InitialViewController.m; sourceTree = SOURCE_ROOT; };
F98356D7192E906600EA6821 /* bluetooth.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bluetooth.png; sourceTree = SOURCE_ROOT; };
@@ -130,6 +133,8 @@
3471866618070D9300FA0FB2 /* FirstApp */ = {
isa = PBXGroup;
children = (
+ F97A7D6E1992DF1A0028036D /* CustomNavigationController.h */,
+ F97A7D6F1992DF1A0028036D /* CustomNavigationController.m */,
34AAB881189804FF0019860D /* MainStoryboard.storyboard */,
34AAB876189804FF0019860D /* DUREXAppDelegate.h */,
34AAB877189804FF0019860D /* DUREXAppDelegate.m */,
@@ -234,7 +239,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = EM;
- LastUpgradeCheck = 0500;
+ LastUpgradeCheck = 0510;
ORGANIZATIONNAME = Emmoco;
TargetAttributes = {
3471867718070D9300FA0FB2 = {
@@ -295,6 +300,7 @@
34AAB883189804FF0019860D /* DUREXAppDelegate.m in Sources */,
F98356DB192EAFD400EA6821 /* CommunicationProtocol.m in Sources */,
F98356E1192EC84700EA6821 /* MenuTableViewController.m in Sources */,
+ F97A7D701992DF1A0028036D /* CustomNavigationController.m in Sources */,
34AAB889189804FF0019860D /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -332,7 +338,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -345,6 +350,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -361,9 +367,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@@ -371,7 +378,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -384,6 +390,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
@@ -394,8 +401,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 7.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.1;
SDKROOT = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -403,13 +411,12 @@
3471868A18070D9300FA0FB2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch";
INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
EmmocoMobileFramework/Framework,
@@ -423,13 +430,12 @@
3471868B18070D9300FA0FB2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FirstAppExample/DUREX test-Prefix.pch";
INFOPLIST_FILE = "FirstAppExample/DUREX test-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
EmmocoMobileFramework/Framework,
@@ -443,7 +449,6 @@
3471868D18070D9300FA0FB2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
@@ -466,7 +471,6 @@
3471868E18070D9300FA0FB2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TestAppExample.app/TestAppExample";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
diff --git a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
index 21bfaef..e90ed43 100644
--- a/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/DUREX tests/DUREX test.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
diff --git a/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index fe2b454..83d4fa5 100644
--- a/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/DUREX tests/DUREX test.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -2,4 +2,38 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/DUREX tests/FirstAppExample/DUREXAppDelegate.h b/DUREX tests/FirstAppExample/DUREXAppDelegate.h
index dfdd593..5630f80 100644
--- a/DUREX tests/FirstAppExample/DUREXAppDelegate.h
+++ b/DUREX tests/FirstAppExample/DUREXAppDelegate.h
@@ -7,11 +7,12 @@
//
#import
+#import "CustomNavigationController.h"
@interface DUREXAppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *window;
-@property (nonatomic, strong) IBOutlet UINavigationController *navController;
+@property (nonatomic, strong) IBOutlet CustomNavigationController *navController;
diff --git a/DUREX tests/FirstAppExample/DUREXAppDelegate.m b/DUREX tests/FirstAppExample/DUREXAppDelegate.m
index afe5bba..888c2b1 100644
--- a/DUREX tests/FirstAppExample/DUREXAppDelegate.m
+++ b/DUREX tests/FirstAppExample/DUREXAppDelegate.m
@@ -20,7 +20,7 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- UINavigationController *navController = (UINavigationController *)[[self window] rootViewController];
+ CustomNavigationController *navController = (CustomNavigationController *)[[self window] rootViewController];
[self setNavController:navController];
[[self navController] setDelegate:self];
diff --git a/DUREX tests/FirstAppExample/MainStoryboard.storyboard b/DUREX tests/FirstAppExample/MainStoryboard.storyboard
index 0381df0..499063b 100644
--- a/DUREX tests/FirstAppExample/MainStoryboard.storyboard
+++ b/DUREX tests/FirstAppExample/MainStoryboard.storyboard
@@ -1,7 +1,7 @@
-
+
@@ -116,10 +116,10 @@
-
+
-
+
diff --git a/DUREX tests/MenuTableViewController.h b/DUREX tests/MenuTableViewController.h
index 8608f28..5731267 100644
--- a/DUREX tests/MenuTableViewController.h
+++ b/DUREX tests/MenuTableViewController.h
@@ -35,4 +35,6 @@ enum {
@property (strong,nonatomic) Stack *parentLayout;
+- (void) navBack;
+
@end
diff --git a/DUREX tests/MenuTableViewController.m b/DUREX tests/MenuTableViewController.m
index 7dca23b..a07ce18 100644
--- a/DUREX tests/MenuTableViewController.m
+++ b/DUREX tests/MenuTableViewController.m
@@ -7,6 +7,7 @@
//
#import "MenuTableViewController.h"
+#import "DUREXAppDelegate.h"
@interface MenuTableViewController ()
{
@@ -71,9 +72,12 @@
[self setCellIdentifiers:[[NSArray alloc] initWithObjects:CELL_IDENTIFIERS, nil]];
}
-- (void) changeNavLevel: (uint8_t) level
+- (void) changeNavLevel: (uint8_t) level : (BOOL) push
{
- [[self parentLayout] push: [NSNumber numberWithUnsignedChar:level]];
+ if(push)
+ {
+ [[self parentLayout] push: [NSNumber numberWithUnsignedChar:self.currentNavLevel]];
+ }
[self setCurrentNavLevel:level];
[self setCurrentCellIdentifier:[[self cellIdentifiers] objectAtIndex:[self currentNavLevel]]];
if([self currentNavLevel] == MAINTENANCE)
@@ -81,6 +85,7 @@
[self setCurrentElements:[self maintenanceElements]];
[self setCurrentStructure:[self maintenanceStructure]];
[self setCurrentHeaders:[self maintenanceHeaders]];
+
}
//AND SO ON...
else
@@ -94,6 +99,13 @@
NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range];
[[self tableView] reloadSections:sections withRowAnimation:UITableViewRowAnimationAutomatic];
}
+
+- (void) navBack
+{
+ NSNumber *prevLevel = [[self parentLayout] pop];
+ self.currentNavLevel = prevLevel.intValue;
+ [self changeNavLevel: prevLevel.intValue : FALSE];
+}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
@@ -128,7 +140,11 @@
//Set navigation level
[self initializeMenuEntries];
- [self changeNavLevel:MENU];
+ self.currentNavLevel = 255;
+ [self changeNavLevel:MENU:FALSE];
+ DUREXAppDelegate *appDelegate = (DUREXAppDelegate *)[[UIApplication sharedApplication] delegate];
+ CustomNavigationController *navController = [appDelegate navController];
+ navController.auxController = self;
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
@@ -162,13 +178,13 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
- NSLog(@"Section: %d Row: %d",[indexPath section],[indexPath row]);
+ NSLog(@"[MenuTableViewController.m]: Section: %d Row: %d",[indexPath section],[indexPath row]);
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSString *cellName = [[[[self tableView] cellForRowAtIndexPath:indexPath]textLabel]text];
if([cellName isEqualToString:@"Maintenance"])
{
- NSLog(@"Changing to navLevel: MAINTENANCE");
- [self changeNavLevel:MAINTENANCE];
+ NSLog(@"[MenuTableViewController.m]: Changing to navLevel: MAINTENANCE");
+ [self changeNavLevel:MAINTENANCE:TRUE];
}
@@ -188,15 +204,15 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
- NSLog(@"navLevel is %d",[self currentNavLevel]);
+ NSLog(@"[MenuTableViewController.m]: navLevel is %d",[self currentNavLevel]);
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self currentCellIdentifier] forIndexPath:indexPath];
if (cell == nil)
{
- NSLog(@"Initializing cell");
+ NSLog(@"[MenuTableViewController.m]: Initializing cell");
if([self currentNavLevel] == MAINTENANCE)
{
- NSLog(@"Dispatching Maintenance-type cell");
+ NSLog(@"[MenuTableViewController.m]: Dispatching Maintenance-type cell");
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:[self currentCellIdentifier]];
}
else
@@ -215,7 +231,7 @@
[[cell textLabel] setText:[[self currentElements] objectAtIndex:[indexPath row]+offset]];
if([self currentNavLevel] == MAINTENANCE)
{
- NSLog(@"Customizing cell for navLevel MAINTENANCE");
+ NSLog(@"[MenuTableViewController.m]: Customizing cell for navLevel MAINTENANCE");
[[cell detailTextLabel] setText:@"VALUE"];
[cell setAccessoryView: [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_checkmark"]]];
if( [[[cell textLabel] text] isEqualToString:@"5€ Notes"])
diff --git a/DUREX tests/Stack.m b/DUREX tests/Stack.m
index 1a635be..9e4aa88 100644
--- a/DUREX tests/Stack.m
+++ b/DUREX tests/Stack.m
@@ -27,7 +27,6 @@
- (void) push: (id) element
{
[[self dataArray] addObject:element];
- printf("%d elements in array\n",[self count]);
}
- (id) pop
{
@@ -42,7 +41,7 @@
}
- (void) clear
{
-
+ [[self dataArray] removeAllObjects];
}
@end