Skip to content
Browse files

search working

  • Loading branch information...
1 parent e38dbe6 commit b8943173a12b6e604800b97c0acf2e32362d90b9 @davidchiles committed Apr 13, 2012
View
BIN .DS_Store
Binary file not shown.
View
12 OPECategoryViewController.h
@@ -9,6 +9,16 @@
#import <UIKit/UIKit.h>
#import "OPETypeViewController.h"
-@interface OPECategoryViewController : UITableViewController
+@interface OPECategoryViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UISearchDisplayDelegate, UISearchBarDelegate>
+
+@property (nonatomic,strong) IBOutlet UITableView * mainTableView;
+@property (nonatomic,strong) UISearchDisplayController * searchDisplayController;
+@property (nonatomic,strong) IBOutlet UISearchBar * searchBar;
+@property (nonatomic,strong) NSDictionary * categoriesAndTypes;
+@property (nonatomic,strong) NSDictionary * types;
+
+@property (nonatomic, strong) id <PassCategoryAndType> delegate;
+
+@property (nonatomic, retain) NSMutableArray *searchResults;
@end
View
92 OPECategoryViewController.m
@@ -11,15 +11,9 @@
@implementation OPECategoryViewController
-
-- (id)initWithStyle:(UITableViewStyle)style
-{
- self = [super initWithStyle:style];
- if (self) {
- // Custom initialization
- }
- return self;
-}
+@synthesize mainTableView,searchBar,searchDisplayController;
+@synthesize categoriesAndTypes,searchResults,types;
+@synthesize delegate;
- (void)didReceiveMemoryWarning
{
@@ -39,7 +33,21 @@ - (void)viewDidLoad
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
+
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
+ OPETagInterpreter * tagInterpreter = [OPETagInterpreter sharedInstance];
+ categoriesAndTypes = tagInterpreter.categoryAndType;
+ NSMutableDictionary * tempTypes = [[NSMutableDictionary alloc] init];
+ for (NSString * category in categoriesAndTypes)
+ {
+ for (NSString * type in [categoriesAndTypes objectForKey:category]) {
+ [tempTypes setObject:category forKey:type];
+ }
+
+ }
+ types = [tempTypes copy];
+ //NSLog(@"Types: %@",types);
+
}
- (void)viewDidUnload
@@ -75,6 +83,25 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
+- (void)handleSearchForTerm:(NSString *)searchTerm
+{
+ searchResults = [[NSMutableArray alloc] init];
+ if ([searchTerm length] != 0)
+ {
+ for (NSString * currentString in types)
+ {
+ //NSLog(@"CurrentString: %@",currentString);
+ if ([currentString rangeOfString:searchTerm options:NSCaseInsensitiveSearch].location != NSNotFound)
+ {
+ NSLog(@"Match");
+ NSDictionary * match = [[NSDictionary alloc] initWithObjectsAndKeys:currentString,@"type",[types objectForKey:currentString],@"category", nil];
+ [searchResults addObject:match];
+
+ }
+ }
+ }
+}
+
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
@@ -86,22 +113,28 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
- OPETagInterpreter * tagInterpreter = [OPETagInterpreter sharedInstance];
- return [tagInterpreter.categoryAndType count];
+ if (tableView == [[self searchDisplayController] searchResultsTableView]) {
+
+ return [searchResults count];
+ }
+ return [categoriesAndTypes count];
//return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
-
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
- OPETagInterpreter * tagInterpreter = [OPETagInterpreter sharedInstance];
- NSArray * categories = [[tagInterpreter.categoryAndType allKeys]sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
+ if (tableView == [[self searchDisplayController] searchResultsTableView]) {
+ cell.textLabel.text = [[self.searchResults objectAtIndex:indexPath.row] objectForKey:@"type"];
+ return cell;
+ }
+
+ NSArray * categories = [[categoriesAndTypes allKeys]sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
cell.textLabel.text = [categories objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -159,15 +192,36 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
+ [tableView deselectRowAtIndexPath:indexPath animated:YES];
+ if (tableView == [[self searchDisplayController] searchResultsTableView]) {
+ if (!delegate) {
+ NSLog(@"delegate is nil");
+ }
+ [[self delegate] setCategoryAndType: [searchResults objectAtIndex:indexPath.row]];
+ [self.navigationController popViewControllerAnimated:YES];
+ }
+ else {
+ OPETypeViewController * viewer = [[OPETypeViewController alloc] initWithNibName:@"OPETypeViewController" bundle:nil];
+ viewer.title = @"Type";
+ viewer.category = [tableView cellForRowAtIndexPath:indexPath].textLabel.text;
+ [viewer setDelegate: [[[self navigationController] viewControllers] objectAtIndex:1]];
+ [self.navigationController pushViewController:viewer animated:YES];
+ }
+
- OPETypeViewController * viewer = [[OPETypeViewController alloc] initWithNibName:@"OPETypeViewController" bundle:nil];
- viewer.title = @"Type";
- viewer.category = [self.tableView cellForRowAtIndexPath:indexPath].textLabel.text;
- [viewer setDelegate: [[[self navigationController] viewControllers] objectAtIndex:1]];
- [self.navigationController pushViewController:viewer animated:YES];
}
+#pragma mark - search delegate
+- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
+shouldReloadTableForSearchString:(NSString *)searchString
+{
+ [self handleSearchForTerm:searchString];
+
+ return YES;
+}
+
+
@end
View
200 OPECategoryViewController.xib
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
- <string key="IBDocument.SystemVersion">11C25</string>
- <string key="IBDocument.InterfaceBuilderVersion">1919</string>
- <string key="IBDocument.AppKitVersion">1138.11</string>
- <string key="IBDocument.HIToolboxVersion">566.00</string>
+ <int key="IBDocument.SystemTarget">1296</int>
+ <string key="IBDocument.SystemVersion">11D50</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.32</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">916</string>
+ <string key="NS.object.0">1181</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
- <string>IBProxyObject</string>
+ <string>IBUISearchDisplayController</string>
<string>IBUITableView</string>
+ <string>IBUIView</string>
+ <string>IBUISearchBar</string>
+ <string>IBProxyObject</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -30,40 +33,99 @@
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
- <object class="IBUITableView" id="873029372">
+ <object class="IBUIView" id="162000008">
<reference key="NSNextResponder"/>
- <int key="NSvFlags">274</int>
- <string key="NSFrame">{{0, 20}, {320, 460}}</string>
+ <int key="NSvFlags">292</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUITableView" id="873029372">
+ <reference key="NSNextResponder" ref="162000008"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrame">{{0, 44}, {320, 416}}</string>
+ <reference key="NSSuperview" ref="162000008"/>
+ <reference key="NSWindow"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIBouncesZoom">NO</bool>
+ <int key="IBUISeparatorStyle">1</int>
+ <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
+ <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
+ <float key="IBUIRowHeight">44</float>
+ <float key="IBUISectionHeaderHeight">22</float>
+ <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ <object class="IBUISearchBar" id="813415477">
+ <reference key="NSNextResponder" ref="162000008"/>
+ <int key="NSvFlags">290</int>
+ <string key="NSFrameSize">{320, 44}</string>
+ <reference key="NSSuperview" ref="162000008"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="873029372"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
+ <int key="IBUIContentMode">3</int>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="IBUITextInputTraits" key="IBTextInputTraits">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ </array>
+ <string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="813415477"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
</object>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClipsSubviews">YES</bool>
- <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
- <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <bool key="IBUIBouncesZoom">NO</bool>
- <int key="IBUISeparatorStyle">1</int>
- <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
- <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
- <float key="IBUIRowHeight">44</float>
- <float key="IBUISectionHeaderHeight">22</float>
- <float key="IBUISectionFooterHeight">22</float>
+ </object>
+ <object class="IBUISearchDisplayController" id="211986953">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchDisplayController</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="211986953"/>
+ </object>
+ <int key="connectionID">23</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
+ <reference key="destination" ref="162000008"/>
+ </object>
+ <int key="connectionID">30</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchBar</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="813415477"/>
+ </object>
+ <int key="connectionID">34</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">mainTableView</string>
+ <reference key="source" ref="372490531"/>
<reference key="destination" ref="873029372"/>
</object>
- <int key="connectionID">5</int>
+ <int key="connectionID">35</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
@@ -81,6 +143,54 @@
</object>
<int key="connectionID">7</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="813415477"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">33</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchBar</string>
+ <reference key="source" ref="211986953"/>
+ <reference key="destination" ref="813415477"/>
+ </object>
+ <int key="connectionID">22</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchContentsController</string>
+ <reference key="source" ref="211986953"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">24</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchResultsDataSource</string>
+ <reference key="source" ref="211986953"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">25</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">searchResultsDelegate</string>
+ <reference key="source" ref="211986953"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">26</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="211986953"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">27</int>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -102,8 +212,27 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="162000008"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="873029372"/>
+ <reference ref="813415477"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="873029372"/>
+ <reference key="parent" ref="162000008"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">20</int>
+ <reference key="object" ref="813415477"/>
+ <reference key="parent" ref="162000008"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="211986953"/>
<reference key="parent" ref="0"/>
</object>
</array>
@@ -113,19 +242,36 @@
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">7</int>
+ <int key="maxID">35</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">OPECategoryViewController</string>
<string key="superclassName">UIViewController</string>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="mainTableView">UITableView</string>
+ <string key="searchBar">UISearchBar</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="mainTableView">
+ <string key="name">mainTableView</string>
+ <string key="candidateClassName">UITableView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="searchBar">
+ <string key="name">searchBar</string>
+ <string key="candidateClassName">UISearchBar</string>
+ </object>
+ </dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/OPECategoryViewController.h</string>
@@ -135,8 +281,12 @@
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <real value="1296" key="NS.object.0"/>
+ </object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">916</string>
+ <string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>
View
8 OSM POI Editor.xcodeproj/project.pbxproj
@@ -8,8 +8,6 @@
/* Begin PBXBuildFile section */
6310F4B6153736D000C65FD8 /* OPEMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 6310F4B5153736D000C65FD8 /* OPEMessage.m */; };
- 6310F4C115378FCB00C65FD8 /* none.png in Resources */ = {isa = PBXBuildFile; fileRef = 6310F4BF15378FCB00C65FD8 /* none.png */; };
- 6310F4C215378FCB00C65FD8 /* none@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6310F4C015378FCB00C65FD8 /* none@2x.png */; };
6310F4C71537A43C00C65FD8 /* newNodeMarker.png in Resources */ = {isa = PBXBuildFile; fileRef = 6310F4C51537A43C00C65FD8 /* newNodeMarker.png */; };
6310F4C81537A43C00C65FD8 /* newNodeMarker@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6310F4C61537A43C00C65FD8 /* newNodeMarker@2x.png */; };
6310F59B1537A46D00C65FD8 /* airplane.png in Resources */ = {isa = PBXBuildFile; fileRef = 6310F4CE1537A46D00C65FD8 /* airplane.png */; };
@@ -347,8 +345,6 @@
/* Begin PBXFileReference section */
6310F4B4153736D000C65FD8 /* OPEMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OPEMessage.h; sourceTree = "<group>"; };
6310F4B5153736D000C65FD8 /* OPEMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OPEMessage.m; sourceTree = "<group>"; };
- 6310F4BF15378FCB00C65FD8 /* none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = none.png; sourceTree = "<group>"; };
- 6310F4C015378FCB00C65FD8 /* none@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "none@2x.png"; sourceTree = "<group>"; };
6310F4C51537A43C00C65FD8 /* newNodeMarker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = newNodeMarker.png; sourceTree = "<group>"; };
6310F4C61537A43C00C65FD8 /* newNodeMarker@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "newNodeMarker@2x.png"; sourceTree = "<group>"; };
6310F4CE1537A46D00C65FD8 /* airplane.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = airplane.png; sourceTree = "<group>"; };
@@ -1124,8 +1120,6 @@
6310F4C51537A43C00C65FD8 /* newNodeMarker.png */,
6310F4C61537A43C00C65FD8 /* newNodeMarker@2x.png */,
63F9CCA414F32B2E00308DE1 /* iphone_delete_button.png */,
- 6310F4BF15378FCB00C65FD8 /* none.png */,
- 6310F4C015378FCB00C65FD8 /* none@2x.png */,
63A2DB4315226CF6000C095D /* gear.png */,
63A2DB4415226CF6000C095D /* gear@2x.png */,
63A2DB3B152257FA000C095D /* userLocation.png */,
@@ -1431,8 +1425,6 @@
63E525E415362B7100D2DA35 /* icon.png in Resources */,
63E525E515362B7100D2DA35 /* icon@2x.png in Resources */,
63E525EB1536560300D2DA35 /* Tags.plist in Resources */,
- 6310F4C115378FCB00C65FD8 /* none.png in Resources */,
- 6310F4C215378FCB00C65FD8 /* none@2x.png in Resources */,
6310F4C71537A43C00C65FD8 /* newNodeMarker.png in Resources */,
6310F4C81537A43C00C65FD8 /* newNodeMarker@2x.png in Resources */,
6310F59B1537A46D00C65FD8 /* airplane.png in Resources */,
View
BIN ...xcodeproj/project.xcworkspace/xcuserdata/David.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
82 OSM POI Editor.xcodeproj/xcuserdata/David.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -37,11 +37,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "355970182.045355"
+ timestampString = "356059160.182623"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "485"
- endingLineNumber = "485"
+ startingLineNumber = "489"
+ endingLineNumber = "489"
landmarkName = "-viewDidAppear:"
landmarkType = "5">
</FileBreakpoint>
@@ -190,11 +190,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "355970182.045355"
+ timestampString = "356059160.182623"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "396"
- endingLineNumber = "396"
+ startingLineNumber = "398"
+ endingLineNumber = "398"
landmarkName = "-setText:"
landmarkType = "5">
</FileBreakpoint>
@@ -203,11 +203,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "355970182.045355"
+ timestampString = "356059160.182623"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "394"
- endingLineNumber = "394"
+ startingLineNumber = "396"
+ endingLineNumber = "396"
landmarkName = "-setText:"
landmarkType = "5">
</FileBreakpoint>
@@ -242,11 +242,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "355887833.471326"
+ timestampString = "356056965.322886"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "224"
- endingLineNumber = "224"
+ startingLineNumber = "225"
+ endingLineNumber = "225"
landmarkName = "-tableView:didSelectRowAtIndexPath:"
landmarkType = "5">
</FileBreakpoint>
@@ -268,11 +268,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OSM POI Editor/OPENodeViewController.m"
- timestampString = "355970182.045355"
+ timestampString = "356059160.182623"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "475"
- endingLineNumber = "475"
+ startingLineNumber = "479"
+ endingLineNumber = "479"
landmarkName = "-uploadComplete:"
landmarkType = "5">
</FileBreakpoint>
@@ -289,6 +289,58 @@
landmarkName = "-createdNode:"
landmarkType = "5">
</FileBreakpoint>
+ <FileBreakpoint
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "OPECategoryViewController.m"
+ timestampString = "356056860.661594"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "94"
+ endingLineNumber = "94"
+ landmarkName = "-handleSearchForTerm:"
+ landmarkType = "5">
+ </FileBreakpoint>
+ <FileBreakpoint
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "OPECategoryViewController.m"
+ timestampString = "356056860.661594"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "97"
+ endingLineNumber = "97"
+ landmarkName = "-handleSearchForTerm:"
+ landmarkType = "5">
+ </FileBreakpoint>
+ <FileBreakpoint
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "OPECategoryViewController.m"
+ timestampString = "356058813.541789"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "196"
+ endingLineNumber = "196"
+ landmarkName = "-tableView:didSelectRowAtIndexPath:"
+ landmarkType = "5">
+ </FileBreakpoint>
+ <FileBreakpoint
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "OSM POI Editor/OPENodeViewController.m"
+ timestampString = "356059160.182623"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "429"
+ endingLineNumber = "429"
+ landmarkName = "-setCategoryAndType:"
+ landmarkType = "5">
+ </FileBreakpoint>
</FileBreakpoints>
<ExceptionBreakpoints>
<ExceptionBreakpoint
View
14 OSM POI Editor/OPENodeViewController.m
@@ -215,6 +215,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
else {
OPECategoryViewController * viewer = [[OPECategoryViewController alloc] initWithNibName:@"OPECategoryViewController" bundle:[NSBundle mainBundle]];
viewer.title = @"Category";
+ [viewer setDelegate:self];
[self.navigationController pushViewController:viewer animated:YES];
}
@@ -225,6 +226,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
{
OPECategoryViewController * viewer = [[OPECategoryViewController alloc] initWithNibName:@"OPECategoryViewController" bundle:[NSBundle mainBundle]];
viewer.title = @"Category";
+ [viewer setDelegate:self];
[self.navigationController pushViewController:viewer animated:YES];
}
@@ -422,15 +424,17 @@ - (void) setText:(NSString *)text
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
}
-- (void) setCategoryAndType:(NSArray *)cAndT
+- (void) setCategoryAndType:(NSDictionary *)cAndT
{
if ([catAndType count]==2) {
[tagInterpreter removeCatAndType:[[NSDictionary alloc] initWithObjectsAndKeys:[catAndType objectAtIndex:1],[catAndType objectAtIndex:0], nil] fromNode:theNewNode];
}
+ NSString * newCategory = [cAndT objectForKey:@"category"];
+ NSString * newType = [cAndT objectForKey:@"type"];
+
- catAndType = cAndT;
- NSDictionary * KV = [tagInterpreter getOSmKeysValues:[[NSDictionary alloc] initWithObjectsAndKeys:[cAndT objectAtIndex:1],[cAndT objectAtIndex:0], nil]];
- NSLog(@"catAndType: %@",catAndType);
+ NSDictionary * KV = [tagInterpreter getOSmKeysValues:[[NSDictionary alloc] initWithObjectsAndKeys:newType,newCategory, nil]];
+ NSLog(@"catAndType: %@",cAndT);
//NSLog(@"KV: %@",osmKeyValue);
@@ -451,7 +455,7 @@ - (void) setCategoryAndType:(NSArray *)cAndT
NSLog(@"Tags: %@",theNewNode.tags);
theNewNode.image = [tagInterpreter getImageForNode:theNewNode];
- catAndType = cAndT;
+ catAndType = [[NSArray alloc] initWithObjects: newCategory ,newType, nil];
//[self.tableView reloadData];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationFade];
}
View
4 OSM POI Editor/OPETypeViewController.h
@@ -10,12 +10,12 @@
@protocol PassCategoryAndType <NSObject>
@required
-- (void) setCategoryAndType:(NSArray *)cAndT;
+- (void) setCategoryAndType:(NSDictionary *)cAndT;
@end
@interface OPETypeViewController : UITableViewController
@property (nonatomic,retain) NSString * category;
-@property (retain) id delegate;
+@property (nonatomic, strong) id delegate;
@end
View
3 OSM POI Editor/OPETypeViewController.m
@@ -160,7 +160,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
- NSArray * cAndT = [[NSArray alloc] initWithObjects:category,[self.tableView cellForRowAtIndexPath:indexPath].textLabel.text ,nil];
+ //NSArray * cAndT = [[NSArray alloc] initWithObjects:category,[self.tableView cellForRowAtIndexPath:indexPath].textLabel.text ,nil];
+ NSDictionary * cAndT = [[NSDictionary alloc] initWithObjectsAndKeys:[self.tableView cellForRowAtIndexPath:indexPath].textLabel.text,@"type",category,@"category", nil];
[[self delegate] setCategoryAndType: cAndT];
//[[self navigationController] popViewControllerAnimated:YES];
[[self navigationController] popToViewController:[[[self navigationController] viewControllers] objectAtIndex:1] animated:YES];

0 comments on commit b894317

Please sign in to comment.
Something went wrong with that request. Please try again.