├── .gitignore ├── .DS_Store ├── Icon.png ├── Default.png ├── icon@2x.png ├── Default@2x.png ├── geoJoy ├── en.lproj │ ├── InfoPlist.strings │ └── MainWindow.xib ├── .DS_Store ├── bookmark.png ├── position.png ├── app_title.png ├── bookmark@2x.png ├── geojoy.sqlite ├── logoClaim.png ├── position@2x.png ├── app_title@2x.png ├── Prueba.h ├── geoJoyAnnotation.h ├── geoJoy-Prefix.pch ├── ConnectedClass.h ├── moreInfoViewController.h ├── main.m ├── geoJoyAnnotation.m ├── geoJoyAppDelegate.h ├── ConnectedClass.m ├── annotationsController.h ├── CLLocationController.h ├── annotationsController.m ├── dbModel.h ├── CLLocationController.m ├── geoJoy-Info.plist ├── addItemViewController.h ├── moreInfoViewController.m ├── itemsListViewController.h ├── geoJoyAppDelegate.m ├── Reachability.h ├── Prueba.m ├── Reachability.m ├── dbModel.m ├── addItemViewController.m └── itemsListViewController.m ├── geoJoyTests ├── en.lproj │ └── InfoPlist.strings ├── geoJoyTests.h ├── geoJoyTests.m └── geoJoyTests-Info.plist ├── geoJoy.xcodeproj ├── xcuserdata │ └── jakobhans.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints.xcbkptlist │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── geoJoy.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jakobhans.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── project.pbxproj └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.DS_Store -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/.DS_Store -------------------------------------------------------------------------------- /Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/Icon.png -------------------------------------------------------------------------------- /Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/Default.png -------------------------------------------------------------------------------- /icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/icon@2x.png -------------------------------------------------------------------------------- /Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/Default@2x.png -------------------------------------------------------------------------------- /geoJoy/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /geoJoy/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/.DS_Store -------------------------------------------------------------------------------- /geoJoyTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /geoJoy/bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/bookmark.png -------------------------------------------------------------------------------- /geoJoy/position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/position.png -------------------------------------------------------------------------------- /geoJoy/app_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/app_title.png -------------------------------------------------------------------------------- /geoJoy/bookmark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/bookmark@2x.png -------------------------------------------------------------------------------- /geoJoy/geojoy.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/geojoy.sqlite -------------------------------------------------------------------------------- /geoJoy/logoClaim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/logoClaim.png -------------------------------------------------------------------------------- /geoJoy/position@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/position@2x.png -------------------------------------------------------------------------------- /geoJoy/app_title@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy/app_title@2x.png -------------------------------------------------------------------------------- /geoJoy.xcodeproj/xcuserdata/jakobhans.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/project.xcworkspace/xcuserdata/jakobhans.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jakobhans/geoJoy-iPhone/HEAD/geoJoy.xcodeproj/project.xcworkspace/xcuserdata/jakobhans.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /geoJoy/Prueba.h: -------------------------------------------------------------------------------- 1 | // 2 | // Prueba.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 27/09/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Prueba : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /geoJoyTests/geoJoyTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyTests.h 3 | // geoJoyTests 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface geoJoyTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /geoJoy/geoJoyAnnotation.h: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyAnnotation.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 23/09/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface geoJoyAnnotation : NSObject { 12 | CLLocationCoordinate2D coordinate; 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /geoJoy/geoJoy-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'geoJoy' target in the 'geoJoy' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /geoJoy/ConnectedClass.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectedClass.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 11/10/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Reachability.h" 11 | #import 12 | 13 | @interface ConnectedClass : NSObject 14 | 15 | -(BOOL)connected; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /geoJoy/moreInfoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // moreInfoViewController.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ConnectedClass.h" 11 | 12 | @interface moreInfoViewController : UIViewController 13 | 14 | -(IBAction)openRepoInSafari; 15 | -(IBAction)openClaimInSafari; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /geoJoy/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /geoJoy/geoJoyAnnotation.m: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyAnnotation.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 23/09/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "geoJoyAnnotation.h" 10 | 11 | @implementation geoJoyAnnotation 12 | 13 | - (id)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | // Initialization code here. 18 | } 19 | 20 | return self; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /geoJoy/geoJoyAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyAppDelegate.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "dbModel.h" 11 | 12 | @interface geoJoyAppDelegate : NSObject 13 | 14 | @property (nonatomic, retain) IBOutlet UIWindow *window; 15 | 16 | @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /geoJoyTests/geoJoyTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyTests.m 3 | // geoJoyTests 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "geoJoyTests.h" 10 | 11 | @implementation geoJoyTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in geoJoyTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /geoJoy/ConnectedClass.m: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectedClass.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 11/10/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ConnectedClass.h" 10 | 11 | @implementation ConnectedClass 12 | 13 | -(BOOL)connected { 14 | Reachability *reachability = [Reachability reachabilityForInternetConnection]; 15 | NetworkStatus networkStatus = [reachability currentReachabilityStatus]; 16 | if (networkStatus == NotReachable) { 17 | return NO; 18 | } else { 19 | return YES; 20 | } 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /geoJoy/annotationsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // annotationsController.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface annotationsController : NSObject { 13 | NSString *_title; 14 | NSString *_subtitle; 15 | CLLocationCoordinate2D _coordinate; 16 | } 17 | 18 | @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; 19 | 20 | -(id)initWithTitle:(NSString *)title subtitle:(NSString *)subtitle coordinate:(CLLocationCoordinate2D)coordinate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /geoJoy/CLLocationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLLocationController.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @protocol CoreLocationControllerDelegate 13 | @required 14 | 15 | -(void)locationUpdate:(CLLocation *)location; 16 | -(void)locationError:(NSError *)error; 17 | 18 | @end 19 | 20 | @interface CLLocationController : NSObject { 21 | CLLocationManager *locMgr; 22 | id delegate; 23 | } 24 | 25 | @property (nonatomic, retain) CLLocationManager *locMgr; 26 | @property (nonatomic, assign) id delegate; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/xcuserdata/jakobhans.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | geoJoy.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 42C589D01402C9D2005D259D 16 | 17 | primary 18 | 19 | 20 | 42C589FA1402C9D2005D259D 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /geoJoyTests/geoJoyTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | claimsoluciones.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /geoJoy/annotationsController.m: -------------------------------------------------------------------------------- 1 | // 2 | // annotationsController.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "annotationsController.h" 10 | 11 | @implementation annotationsController 12 | 13 | @synthesize title = _title; 14 | @synthesize subtitle = _subtitle; 15 | @synthesize coordinate = _coordinate; 16 | 17 | -(id)initWithTitle:(NSString *)title subtitle:(NSString *)subtitle coordinate:(CLLocationCoordinate2D)coordinate { 18 | if ((self = [super init])) { 19 | _title = [title copy]; 20 | _subtitle = [subtitle copy]; 21 | _coordinate = coordinate; 22 | } 23 | return self; 24 | } 25 | 26 | -(void)dealloc { 27 | [_title release]; 28 | [_subtitle release]; 29 | [super dealloc]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /geoJoy/dbModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // dbModel.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "CLLocationController.h" 12 | 13 | @interface dbModel : NSObject 14 | 15 | -(id)initAndCreateDatabaseIfNeeded; 16 | -(int)getNumberOfItemsInTable; 17 | -(BOOL)addNewItemWithName:(NSString *)name latitude:(float)latitude longitude:(float)longitude category:(NSString *)category; 18 | -(int)getCategoriesNumber:(NSArray *)categories; 19 | -(int)getItemsCountByCategory:(NSString *)category; 20 | -(BOOL)deleteItemWithID:(NSNumber *)ID; 21 | -(BOOL)updateItemWithID:(NSNumber *)ID toName:(NSString *)name andCategory:(NSString *)category; 22 | -(NSMutableArray *)getAllItemsByCategory:(NSString*)category; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | THIS VERSION IS VERY OLD, NO LONGER IN THE APP STORE. MIGHT UPDATE IT SOMETIME IN THE FUTURE. LEFT FOR LEARNING/SHARING PURPOSES. 2 | 3 | geoJoy iPhone App 4 | =============== 5 | 6 | App Description 7 | ---------------------- 8 | The geoJoy app is all about location and privacy. Save the current location in your iPhone device with a label for later reviewing within categories. The geodata, label property and the categories are saved locally in an SQLite database managed by the app itself. 9 | 10 | License 11 | ---------- 12 | The geoJoy iPhone app by Claim Soluciones, S.C.P. is licensed under a GNU General Public License, version 3 (GPL v3). Permissions beyond the scope of this license may be available at http://www.claimsoluciones.com or by writing to info@claimsoluciones.com by email. 13 | 14 | License Info: http://www.opensource.org/licenses/gpl-3.0.html 15 | 16 | Source Code: https://github.com/ClaimSoluciones/geoJoy-iPhone 17 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/project.xcworkspace/xcuserdata/jakobhans.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 0 7 | IDEWorkspaceUserSettings_BuildSubfolderNameStyle 8 | 0 9 | IDEWorkspaceUserSettings_DerivedDataLocationStyle 10 | 0 11 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 12 | 13 | IDEWorkspaceUserSettings_IssueFilterStyle 14 | 0 15 | IDEWorkspaceUserSettings_LiveSourceIssuesEnabled 16 | 17 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 18 | 19 | IDEWorkspaceUserSettings_SnapshotLocationStyle 20 | 0 21 | 22 | 23 | -------------------------------------------------------------------------------- /geoJoy/CLLocationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLLocationController.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "CLLocationController.h" 10 | 11 | @implementation CLLocationController 12 | 13 | @synthesize locMgr, delegate; 14 | 15 | - (id)init 16 | { 17 | self = [super init]; 18 | if (self != nil) { 19 | self.locMgr = [[[CLLocationManager alloc] init] autorelease]; 20 | self.locMgr.delegate = self; 21 | self.locMgr.desiredAccuracy = kCLLocationAccuracyBest; 22 | self.locMgr.distanceFilter = 50; 23 | } 24 | [self.locMgr startUpdatingLocation]; 25 | return self; 26 | } 27 | 28 | -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { 29 | if ([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { 30 | [self.delegate locationUpdate:newLocation]; 31 | } 32 | } 33 | 34 | -(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { 35 | if ([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { 36 | [self.delegate locationError:error]; 37 | } 38 | } 39 | 40 | -(void)dealloc { 41 | [locMgr release]; 42 | [super dealloc]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /geoJoy/geoJoy-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | icon@2x.png 14 | Icon.png 15 | 16 | CFBundleIdentifier 17 | claimsoluciones.geojoy 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | geojoy 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | 1.1 26 | CFBundleSignature 27 | CSGJ 28 | CFBundleVersion 29 | 1.1 30 | LSRequiresIPhoneOS 31 | 32 | NSMainNibFile 33 | MainWindow 34 | NSMainNibFile~iphone 35 | MainWindow 36 | UIPrerenderedIcon 37 | 38 | UIRequiredDeviceCapabilities 39 | 40 | location-services 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /geoJoy/addItemViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // addItemViewController.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CLLocationController.h" 11 | #import "annotationsController.h" 12 | #import "dbModel.h" 13 | #import "ConnectedClass.h" 14 | 15 | @interface addItemViewController : UIViewController { 16 | 17 | IBOutlet UIBarButtonItem *addDisplayLocationButton; 18 | IBOutlet UIBarButtonItem *updateLocationButton; 19 | IBOutlet UIButton *setCategoryButton; 20 | IBOutlet UITextField *itemLabel; 21 | IBOutlet UILabel *loadingViewText; 22 | IBOutlet UIPickerView *categoriesPicker; 23 | 24 | IBOutlet MKMapView *map; 25 | 26 | IBOutlet UIView *mapView; 27 | IBOutlet UIView *loadingView; 28 | IBOutlet UIView *categoriesView; 29 | IBOutlet UIView *containerView; 30 | 31 | NSString *pickerString; 32 | int pickerValue; 33 | NSArray *categories; 34 | BOOL mapScreenOnTop; 35 | 36 | CLLocationController *CLController; 37 | CLLocation *positionToBeSaved; 38 | 39 | dbModel *model; 40 | } 41 | 42 | @property (nonatomic, retain) dbModel *model; 43 | @property (nonatomic, retain) MKMapView *map; 44 | @property (nonatomic, retain) UIBarButtonItem *addDisplayLocationButton; 45 | @property (nonatomic, retain) UIButton *setCategoryButton; 46 | @property (nonatomic, retain) UITextField *itemLabel; 47 | @property (nonatomic, retain) UILabel *loadingViewText; 48 | @property (nonatomic, retain) UIView *loadingView, *categoriesView, *mapView, *containerView; 49 | @property (nonatomic, assign) CLLocation *positionToBeSaved; 50 | @property (nonatomic, retain) CLLocationController *CLController; 51 | 52 | -(IBAction)addCurrentLocation; 53 | -(IBAction)toggleToCategories; 54 | -(IBAction)updatelocation; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /geoJoy/moreInfoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // moreInfoViewController.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "moreInfoViewController.h" 10 | 11 | @implementation moreInfoViewController 12 | 13 | -(void)checkForConnection { 14 | ConnectedClass *connection = [[ConnectedClass alloc] init]; 15 | 16 | if ([connection connected] == NO) { 17 | UIAlertView *alertDialog = [[UIAlertView alloc] initWithTitle:@"Internet Connection" message:@"This application needs an internet connection to work properly. Please activate either a WiFi or a cellular data connection." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 18 | [alertDialog show]; 19 | [alertDialog release]; 20 | } 21 | 22 | [connection release]; 23 | } 24 | 25 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 26 | { 27 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 28 | if (self) { 29 | // Custom initialization 30 | } 31 | return self; 32 | } 33 | 34 | - (void)didReceiveMemoryWarning 35 | { 36 | // Releases the view if it doesn't have a superview. 37 | [super didReceiveMemoryWarning]; 38 | 39 | // Release any cached data, images, etc that aren't in use. 40 | } 41 | 42 | -(IBAction)openRepoInSafari { 43 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/ClaimSoluciones/geoJoy-iPhone"]]; 44 | } 45 | 46 | -(IBAction)openClaimInSafari { 47 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.claimsoluciones.com"]]; 48 | } 49 | 50 | #pragma mark - View lifecycle 51 | 52 | -(void)viewWillAppear:(BOOL)animated { 53 | [self checkForConnection]; 54 | } 55 | 56 | - (void)viewDidLoad 57 | { 58 | [super viewDidLoad]; 59 | // Do any additional setup after loading the view from its nib. 60 | } 61 | 62 | - (void)viewDidUnload 63 | { 64 | [super viewDidUnload]; 65 | // Release any retained subviews of the main view. 66 | // e.g. self.myOutlet = nil; 67 | } 68 | 69 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 70 | { 71 | // Return YES for supported orientations 72 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /geoJoy/itemsListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // itemsListViewController.h 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "annotationsController.h" 12 | #import "dbModel.h" 13 | #import "CLLocationController.h" 14 | #import "ConnectedClass.h" 15 | 16 | @interface itemsListViewController : UIViewController { 17 | 18 | IBOutlet UIView *theTableView; 19 | IBOutlet UIView *detailsView; 20 | IBOutlet UIView *detailsMapView; 21 | IBOutlet UIView *detailsEditView; 22 | IBOutlet UILabel *itemsCountLabel; 23 | 24 | IBOutlet UIBarButtonItem *generalEditButton; 25 | 26 | IBOutlet UIPickerView *editCategoriesPicker; 27 | IBOutlet UITextField *editItemLabel; 28 | IBOutlet UIButton *editSaveItem; 29 | IBOutlet UIBarButtonItem *backToList; 30 | 31 | IBOutlet UITableView *itemsTable; 32 | 33 | IBOutlet MKMapView *detailMap; 34 | CLLocationController *CLControllerSecondView; 35 | 36 | dbModel *model; 37 | NSString *pickerString; 38 | int pickerValue; 39 | int geoItemsCount; 40 | int categoriesCount; 41 | NSArray *categories; 42 | NSMutableArray *categoriesTitles; 43 | NSMutableArray *itemsData; 44 | NSMutableArray *selectedItem; 45 | BOOL tableViewIsOnTop; 46 | BOOL withinDetailsMapIsOnTop; 47 | BOOL editingTable; 48 | } 49 | 50 | @property (nonatomic, readwrite) int pickerValue, geoItemsCount, categoriesCount; 51 | @property (nonatomic, retain) NSArray *categories; 52 | @property (nonatomic, retain) NSMutableArray *categoriesTitles, *itemsData, *selectedItem; 53 | @property (nonatomic, retain) UIView *detailsView, *theTableView, *detailsMapView, *detailsEditView; 54 | @property (nonatomic, retain) UILabel *itemsCountLabel; 55 | @property (nonatomic, retain) UIBarButtonItem *generalEditButton, *backToList; 56 | @property (nonatomic, retain) UITextField *editItemLabel; 57 | @property (nonatomic, retain) UIButton *editSaveItem; 58 | @property (nonatomic, retain) UITableView *itemsTable; 59 | @property (nonatomic, retain) MKMapView *detailMap; 60 | @property (nonatomic, retain) UIPickerView *editCategoriesPicker; 61 | @property (nonatomic, retain) CLLocationController *CLControllerSecondView; 62 | @property (nonatomic, retain) dbModel *model; 63 | 64 | -(IBAction)saveEditedItem; 65 | -(IBAction)editButtonPressed; 66 | -(IBAction)backToListButtonPressed; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /geoJoy/geoJoyAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // geoJoyAppDelegate.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "geoJoyAppDelegate.h" 10 | 11 | @implementation geoJoyAppDelegate 12 | 13 | @synthesize window = _window; 14 | @synthesize tabBarController = _tabBarController; 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | // Override point for customization after application launch. 19 | // Add the tab bar controller's current view as a subview of the window 20 | 21 | dbModel *initiateDB = [[dbModel alloc] initAndCreateDatabaseIfNeeded]; 22 | [initiateDB release]; 23 | 24 | [application setStatusBarStyle:UIStatusBarStyleBlackOpaque]; 25 | 26 | self.window.rootViewController = self.tabBarController; 27 | [self.window makeKeyAndVisible]; 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application 32 | { 33 | /* 34 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 35 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 36 | */ 37 | } 38 | 39 | - (void)applicationDidEnterBackground:(UIApplication *)application 40 | { 41 | /* 42 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 43 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | */ 45 | } 46 | 47 | - (void)applicationWillEnterForeground:(UIApplication *)application 48 | { 49 | /* 50 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 51 | */ 52 | } 53 | 54 | - (void)applicationDidBecomeActive:(UIApplication *)application 55 | { 56 | /* 57 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 58 | */ 59 | } 60 | 61 | - (void)applicationWillTerminate:(UIApplication *)application 62 | { 63 | /* 64 | Called when the application is about to terminate. 65 | Save data if appropriate. 66 | See also applicationDidEnterBackground:. 67 | */ 68 | } 69 | 70 | - (void)dealloc 71 | { 72 | [_window release]; 73 | [_tabBarController release]; 74 | [super dealloc]; 75 | } 76 | 77 | /* 78 | // Optional UITabBarControllerDelegate method. 79 | - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController 80 | { 81 | } 82 | */ 83 | 84 | /* 85 | // Optional UITabBarControllerDelegate method. 86 | - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed 87 | { 88 | } 89 | */ 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/xcuserdata/jakobhans.xcuserdatad/xcschemes/geoJoy.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 32 | 38 | 39 | 40 | 41 | 42 | 48 | 49 | 50 | 51 | 59 | 60 | 66 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 84 | 85 | 86 | 87 | 89 | 90 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /geoJoy/Reachability.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: Reachability.h 4 | Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 5 | 6 | Version: 2.2 7 | 8 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. 9 | ("Apple") in consideration of your agreement to the following terms, and your 10 | use, installation, modification or redistribution of this Apple software 11 | constitutes acceptance of these terms. If you do not agree with these terms, 12 | please do not use, install, modify or redistribute this Apple software. 13 | 14 | In consideration of your agreement to abide by the following terms, and subject 15 | to these terms, Apple grants you a personal, non-exclusive license, under 16 | Apple's copyrights in this original Apple software (the "Apple Software"), to 17 | use, reproduce, modify and redistribute the Apple Software, with or without 18 | modifications, in source and/or binary forms; provided that if you redistribute 19 | the Apple Software in its entirety and without modifications, you must retain 20 | this notice and the following text and disclaimers in all such redistributions 21 | of the Apple Software. 22 | Neither the name, trademarks, service marks or logos of Apple Inc. may be used 23 | to endorse or promote products derived from the Apple Software without specific 24 | prior written permission from Apple. Except as expressly stated in this notice, 25 | no other rights or licenses, express or implied, are granted by Apple herein, 26 | including but not limited to any patent rights that may be infringed by your 27 | derivative works or by other works in which the Apple Software may be 28 | incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO 31 | WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 32 | WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 33 | PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 34 | COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 37 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 38 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 39 | ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR 40 | DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF 41 | CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF 42 | APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2010 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | 48 | 49 | #import 50 | #import 51 | #import 52 | 53 | typedef enum { 54 | NotReachable = 0, 55 | ReachableViaWiFi, 56 | ReachableViaWWAN 57 | } NetworkStatus; 58 | #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" 59 | 60 | @interface Reachability: NSObject 61 | { 62 | BOOL localWiFiRef; 63 | SCNetworkReachabilityRef reachabilityRef; 64 | } 65 | 66 | //reachabilityWithHostName- Use to check the reachability of a particular host name. 67 | + (Reachability*) reachabilityWithHostName: (NSString*) hostName; 68 | 69 | //reachabilityWithAddress- Use to check the reachability of a particular IP address. 70 | + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; 71 | 72 | //reachabilityForInternetConnection- checks whether the default route is available. 73 | // Should be used by applications that do not connect to a particular host 74 | + (Reachability*) reachabilityForInternetConnection; 75 | 76 | //reachabilityForLocalWiFi- checks whether a local wifi connection is available. 77 | + (Reachability*) reachabilityForLocalWiFi; 78 | 79 | //Start listening for reachability notifications on the current run loop 80 | - (BOOL) startNotifier; 81 | - (void) stopNotifier; 82 | 83 | - (NetworkStatus) currentReachabilityStatus; 84 | //WWAN may be available, but not active until a connection has been established. 85 | //WiFi may require a connection for VPN on Demand. 86 | - (BOOL) connectionRequired; 87 | @end 88 | 89 | 90 | -------------------------------------------------------------------------------- /geoJoy/Prueba.m: -------------------------------------------------------------------------------- 1 | // 2 | // Prueba.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 27/09/11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "Prueba.h" 10 | 11 | 12 | @implementation Prueba 13 | 14 | - (id)initWithStyle:(UITableViewStyle)style 15 | { 16 | self = [super initWithStyle:style]; 17 | if (self) { 18 | // Custom initialization 19 | } 20 | return self; 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | // Releases the view if it doesn't have a superview. 26 | [super didReceiveMemoryWarning]; 27 | 28 | // Release any cached data, images, etc that aren't in use. 29 | } 30 | 31 | #pragma mark - View lifecycle 32 | 33 | - (void)viewDidLoad 34 | { 35 | [super viewDidLoad]; 36 | 37 | // Uncomment the following line to preserve selection between presentations. 38 | // self.clearsSelectionOnViewWillAppear = NO; 39 | 40 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 41 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 42 | } 43 | 44 | - (void)viewDidUnload 45 | { 46 | [super viewDidUnload]; 47 | // Release any retained subviews of the main view. 48 | // e.g. self.myOutlet = nil; 49 | } 50 | 51 | - (void)viewWillAppear:(BOOL)animated 52 | { 53 | [super viewWillAppear:animated]; 54 | } 55 | 56 | - (void)viewDidAppear:(BOOL)animated 57 | { 58 | [super viewDidAppear:animated]; 59 | } 60 | 61 | - (void)viewWillDisappear:(BOOL)animated 62 | { 63 | [super viewWillDisappear:animated]; 64 | } 65 | 66 | - (void)viewDidDisappear:(BOOL)animated 67 | { 68 | [super viewDidDisappear:animated]; 69 | } 70 | 71 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 72 | { 73 | // Return YES for supported orientations 74 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 75 | } 76 | 77 | #pragma mark - Table view data source 78 | 79 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 80 | { 81 | #warning Potentially incomplete method implementation. 82 | // Return the number of sections. 83 | return 0; 84 | } 85 | 86 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 87 | { 88 | #warning Incomplete method implementation. 89 | // Return the number of rows in the section. 90 | return 0; 91 | } 92 | 93 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 94 | { 95 | static NSString *CellIdentifier = @"Cell"; 96 | 97 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 98 | if (cell == nil) { 99 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 100 | } 101 | 102 | // Configure the cell... 103 | 104 | return cell; 105 | } 106 | 107 | /* 108 | // Override to support conditional editing of the table view. 109 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 110 | { 111 | // Return NO if you do not want the specified item to be editable. 112 | return YES; 113 | } 114 | */ 115 | 116 | /* 117 | // Override to support editing the table view. 118 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 119 | { 120 | if (editingStyle == UITableViewCellEditingStyleDelete) { 121 | // Delete the row from the data source 122 | [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; 123 | } 124 | else if (editingStyle == UITableViewCellEditingStyleInsert) { 125 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 126 | } 127 | } 128 | */ 129 | 130 | /* 131 | // Override to support rearranging the table view. 132 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath 133 | { 134 | } 135 | */ 136 | 137 | /* 138 | // Override to support conditional rearranging of the table view. 139 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 140 | { 141 | // Return NO if you do not want the item to be re-orderable. 142 | return YES; 143 | } 144 | */ 145 | 146 | #pragma mark - Table view delegate 147 | 148 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 149 | { 150 | // Navigation logic may go here. Create and push another view controller. 151 | /* 152 | <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; 153 | // ... 154 | // Pass the selected object to the new view controller. 155 | [self.navigationController pushViewController:detailViewController animated:YES]; 156 | [detailViewController release]; 157 | */ 158 | } 159 | 160 | @end 161 | -------------------------------------------------------------------------------- /geoJoy/Reachability.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | File: Reachability.m 4 | Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. 5 | 6 | Version: 2.2 7 | 8 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. 9 | ("Apple") in consideration of your agreement to the following terms, and your 10 | use, installation, modification or redistribution of this Apple software 11 | constitutes acceptance of these terms. If you do not agree with these terms, 12 | please do not use, install, modify or redistribute this Apple software. 13 | 14 | In consideration of your agreement to abide by the following terms, and subject 15 | to these terms, Apple grants you a personal, non-exclusive license, under 16 | Apple's copyrights in this original Apple software (the "Apple Software"), to 17 | use, reproduce, modify and redistribute the Apple Software, with or without 18 | modifications, in source and/or binary forms; provided that if you redistribute 19 | the Apple Software in its entirety and without modifications, you must retain 20 | this notice and the following text and disclaimers in all such redistributions 21 | of the Apple Software. 22 | Neither the name, trademarks, service marks or logos of Apple Inc. may be used 23 | to endorse or promote products derived from the Apple Software without specific 24 | prior written permission from Apple. Except as expressly stated in this notice, 25 | no other rights or licenses, express or implied, are granted by Apple herein, 26 | including but not limited to any patent rights that may be infringed by your 27 | derivative works or by other works in which the Apple Software may be 28 | incorporated. 29 | 30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO 31 | WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 32 | WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 33 | PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 34 | COMBINATION WITH YOUR PRODUCTS. 35 | 36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 37 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 38 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 39 | ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR 40 | DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF 41 | CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF 42 | APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2010 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | 55 | #import 56 | 57 | #import "Reachability.h" 58 | 59 | #define kShouldPrintReachabilityFlags 1 60 | 61 | static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) 62 | { 63 | #if kShouldPrintReachabilityFlags 64 | 65 | /*NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", 66 | (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', 67 | (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', 68 | 69 | (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', 70 | (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', 71 | (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', 72 | (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', 73 | (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', 74 | (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', 75 | (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', 76 | comment 77 | );*/ 78 | #endif 79 | } 80 | 81 | 82 | @implementation Reachability 83 | static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) 84 | { 85 | #pragma unused (target, flags) 86 | NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); 87 | NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); 88 | 89 | //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively 90 | // in case someon uses the Reachablity object in a different thread. 91 | NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; 92 | 93 | Reachability* noteObject = (Reachability*) info; 94 | // Post a notification to notify the client that the network reachability changed. 95 | [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; 96 | 97 | [myPool release]; 98 | } 99 | 100 | - (BOOL) startNotifier 101 | { 102 | BOOL retVal = NO; 103 | SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; 104 | if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) 105 | { 106 | if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) 107 | { 108 | retVal = YES; 109 | } 110 | } 111 | return retVal; 112 | } 113 | 114 | - (void) stopNotifier 115 | { 116 | if(reachabilityRef!= NULL) 117 | { 118 | SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 119 | } 120 | } 121 | 122 | - (void) dealloc 123 | { 124 | [self stopNotifier]; 125 | if(reachabilityRef!= NULL) 126 | { 127 | CFRelease(reachabilityRef); 128 | } 129 | [super dealloc]; 130 | } 131 | 132 | + (Reachability*) reachabilityWithHostName: (NSString*) hostName; 133 | { 134 | Reachability* retVal = NULL; 135 | SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); 136 | if(reachability!= NULL) 137 | { 138 | retVal= [[[self alloc] init] autorelease]; 139 | if(retVal!= NULL) 140 | { 141 | retVal->reachabilityRef = reachability; 142 | retVal->localWiFiRef = NO; 143 | } 144 | } 145 | return retVal; 146 | } 147 | 148 | + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; 149 | { 150 | SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); 151 | Reachability* retVal = NULL; 152 | if(reachability!= NULL) 153 | { 154 | retVal= [[[self alloc] init] autorelease]; 155 | if(retVal!= NULL) 156 | { 157 | retVal->reachabilityRef = reachability; 158 | retVal->localWiFiRef = NO; 159 | } 160 | } 161 | return retVal; 162 | } 163 | 164 | + (Reachability*) reachabilityForInternetConnection; 165 | { 166 | struct sockaddr_in zeroAddress; 167 | bzero(&zeroAddress, sizeof(zeroAddress)); 168 | zeroAddress.sin_len = sizeof(zeroAddress); 169 | zeroAddress.sin_family = AF_INET; 170 | return [self reachabilityWithAddress: &zeroAddress]; 171 | } 172 | 173 | + (Reachability*) reachabilityForLocalWiFi; 174 | { 175 | struct sockaddr_in localWifiAddress; 176 | bzero(&localWifiAddress, sizeof(localWifiAddress)); 177 | localWifiAddress.sin_len = sizeof(localWifiAddress); 178 | localWifiAddress.sin_family = AF_INET; 179 | // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 180 | localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); 181 | Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; 182 | if(retVal!= NULL) 183 | { 184 | retVal->localWiFiRef = YES; 185 | } 186 | return retVal; 187 | } 188 | 189 | #pragma mark Network Flag Handling 190 | 191 | - (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags 192 | { 193 | PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); 194 | 195 | BOOL retVal = NotReachable; 196 | if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) 197 | { 198 | retVal = ReachableViaWiFi; 199 | } 200 | return retVal; 201 | } 202 | 203 | - (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags 204 | { 205 | PrintReachabilityFlags(flags, "networkStatusForFlags"); 206 | if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) 207 | { 208 | // if target host is not reachable 209 | return NotReachable; 210 | } 211 | 212 | BOOL retVal = NotReachable; 213 | 214 | if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) 215 | { 216 | // if target host is reachable and no connection is required 217 | // then we'll assume (for now) that your on Wi-Fi 218 | retVal = ReachableViaWiFi; 219 | } 220 | 221 | 222 | if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || 223 | (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) 224 | { 225 | // ... and the connection is on-demand (or on-traffic) if the 226 | // calling application is using the CFSocketStream or higher APIs 227 | 228 | if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) 229 | { 230 | // ... and no [user] intervention is needed 231 | retVal = ReachableViaWiFi; 232 | } 233 | } 234 | 235 | if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) 236 | { 237 | // ... but WWAN connections are OK if the calling application 238 | // is using the CFNetwork (CFSocketStream?) APIs. 239 | retVal = ReachableViaWWAN; 240 | } 241 | return retVal; 242 | } 243 | 244 | - (BOOL) connectionRequired; 245 | { 246 | NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); 247 | SCNetworkReachabilityFlags flags; 248 | if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 249 | { 250 | return (flags & kSCNetworkReachabilityFlagsConnectionRequired); 251 | } 252 | return NO; 253 | } 254 | 255 | - (NetworkStatus) currentReachabilityStatus 256 | { 257 | NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); 258 | NetworkStatus retVal = NotReachable; 259 | SCNetworkReachabilityFlags flags; 260 | if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) 261 | { 262 | if(localWiFiRef) 263 | { 264 | retVal = [self localWiFiStatusForFlags: flags]; 265 | } 266 | else 267 | { 268 | retVal = [self networkStatusForFlags: flags]; 269 | } 270 | } 271 | return retVal; 272 | } 273 | @end 274 | -------------------------------------------------------------------------------- /geoJoy/dbModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // dbModel.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 24/09/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "dbModel.h" 10 | 11 | @implementation dbModel 12 | 13 | -(id)initAndCreateDatabaseIfNeeded { 14 | self = [super init]; 15 | if (self) { 16 | self = [super init]; 17 | BOOL success; 18 | NSFileManager *fileManager = [NSFileManager defaultManager]; 19 | NSError *error; 20 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 21 | NSString *documentsDirectory = [paths objectAtIndex:0]; 22 | NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"geojoy.sqlite"]; 23 | 24 | success = [fileManager fileExistsAtPath:writableDBPath]; 25 | 26 | if (!success) { 27 | NSLog(@"Creating editable copy of database"); 28 | NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"geojoy.sqlite"]; 29 | success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&error]; 30 | if (!success) { 31 | NSAssert1(0, @"Failed to create writable database file with message '@%'.", [error localizedDescription]); 32 | } else { 33 | NSLog(@"Database copied correctly to user's Documents path."); 34 | } 35 | } else { 36 | return self; 37 | } 38 | } 39 | return self; 40 | } 41 | 42 | -(sqlite3 *)getNewDBConnection { 43 | sqlite3 *dbPointer; 44 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 45 | NSString *documentsDirectory = [paths objectAtIndex:0]; 46 | NSString *path = [documentsDirectory stringByAppendingPathComponent:@"geojoy.sqlite"]; 47 | 48 | if (sqlite3_open([path UTF8String], &dbPointer) != SQLITE_OK) { 49 | NSLog(@"Error in opening database"); 50 | } 51 | return dbPointer; 52 | } 53 | 54 | -(int)getNumberOfItemsInTable { 55 | sqlite3 *dbPointer = [self getNewDBConnection]; 56 | sqlite3_stmt *statement = nil; 57 | int result = 0; 58 | const char *query_stmt = "SELECT COUNT (*) FROM locationItems"; 59 | 60 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 61 | NSLog(@"Error preparing statement /getNumberOfItemsInTable/ %s", sqlite3_errmsg(dbPointer)); 62 | } else { 63 | while (sqlite3_step(statement) == SQLITE_ROW) { 64 | result = sqlite3_column_int(statement,0); 65 | } 66 | } 67 | 68 | sqlite3_finalize(statement); 69 | sqlite3_close(dbPointer); 70 | 71 | return result; 72 | } 73 | 74 | -(int)getLastIDNumber { 75 | sqlite3 *dbPointer = [self getNewDBConnection]; 76 | sqlite3_stmt *statement = nil; 77 | int result = 0; 78 | const char *query_stmt = "SELECT id FROM locationItems"; 79 | 80 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 81 | NSLog(@"Error preparing statement /getLastIDNumber/ %s", sqlite3_errmsg(dbPointer)); 82 | } else { 83 | while (sqlite3_step(statement) == SQLITE_ROW) { 84 | result = sqlite3_column_int(statement, 0); 85 | } 86 | } 87 | 88 | sqlite3_finalize(statement); 89 | sqlite3_close(dbPointer); 90 | 91 | return result; 92 | } 93 | 94 | -(BOOL)addNewItemWithName:(NSString *)name latitude:(float)latitude longitude:(float)longitude category:(NSString *)category { 95 | sqlite3 *dbPointer = [self getNewDBConnection]; 96 | sqlite3_stmt *statement = nil; 97 | int new_item_id = [self getLastIDNumber] + 1; 98 | BOOL success; 99 | NSString *sql_query = [NSString stringWithFormat:@"INSERT INTO locationItems (id, label, category, latitude, longitude, creationDate) VALUES('%i', '%s', '%s', '%f', '%f', DATETIME('now'))", new_item_id, [name UTF8String], [category UTF8String], latitude, longitude]; 100 | const char *query_stmt = [sql_query UTF8String]; 101 | 102 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 103 | NSLog(@"Error preparing statement /addNewItem/ %s", sqlite3_errmsg(dbPointer)); 104 | success = NO; 105 | } else { 106 | if (sqlite3_step(statement)) { 107 | success = YES; 108 | } else { 109 | success = NO; 110 | } 111 | } 112 | 113 | sqlite3_finalize(statement); 114 | sqlite3_close(dbPointer); 115 | 116 | return success; 117 | } 118 | 119 | -(BOOL)updateItemWithID:(NSNumber *)ID toName:(NSString *)name andCategory:(NSString *)category { 120 | sqlite3 *dbPointer = [self getNewDBConnection]; 121 | sqlite3_stmt *statement = nil; 122 | BOOL success; 123 | NSString *sql_query = [NSString stringWithFormat:@"UPDATE locationItems SET label='%s', category='%s' WHERE id='%i'", [name UTF8String], [category UTF8String], [ID intValue]]; 124 | const char *query_stmt = [sql_query UTF8String]; 125 | 126 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 127 | NSLog(@"Error preparing statement /addNewItem/ %s", sqlite3_errmsg(dbPointer)); 128 | success = NO; 129 | } else { 130 | if (sqlite3_step(statement)) { 131 | success = YES; 132 | } else { 133 | success = NO; 134 | } 135 | } 136 | 137 | sqlite3_finalize(statement); 138 | sqlite3_close(dbPointer); 139 | 140 | return success; 141 | } 142 | 143 | -(int)getCategoriesNumber:(NSArray *)categories { 144 | sqlite3 *dbPointer = [self getNewDBConnection]; 145 | int indCounter = 0; 146 | int catsCounter = 0; 147 | for (NSString *category in categories) { 148 | sqlite3_stmt *statement = nil; 149 | NSString *sql_query = [NSString stringWithFormat:@"SELECT id FROM locationItems WHERE category='%@'", category]; 150 | const char *query_stmt = [sql_query UTF8String]; 151 | 152 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 153 | NSLog(@"Error preparing statement /getLastIDNumber/ %s", sqlite3_errmsg(dbPointer)); 154 | } else { 155 | if (sqlite3_step(statement) == SQLITE_ROW) { 156 | indCounter++; 157 | } 158 | } 159 | sqlite3_finalize(statement); 160 | 161 | if (indCounter > 0) { 162 | catsCounter++; 163 | indCounter = 0; 164 | } 165 | } 166 | 167 | sqlite3_close(dbPointer); 168 | 169 | return catsCounter; 170 | } 171 | 172 | -(int)getItemsCountByCategory:(NSString *)category { 173 | sqlite3 *dbPointer = [self getNewDBConnection]; 174 | int indCounter = 0; 175 | sqlite3_stmt *statement = nil; 176 | NSString *sql_query = [NSString stringWithFormat:@"SELECT id FROM locationItems WHERE category='%@'", category]; 177 | const char *query_stmt = [sql_query UTF8String]; 178 | 179 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 180 | NSLog(@"Error preparing statement /getLastIDNumber/ %s", sqlite3_errmsg(dbPointer)); 181 | } else { 182 | while(sqlite3_step(statement) == SQLITE_ROW) { 183 | if (sqlite3_column_int(statement, 0) > 0) { 184 | indCounter++; 185 | } 186 | } 187 | } 188 | sqlite3_finalize(statement); 189 | sqlite3_close(dbPointer); 190 | 191 | return indCounter; 192 | } 193 | 194 | -(NSMutableArray *)getAllItemsByCategory:(NSString*)category { 195 | NSMutableArray *categoryArray = [[NSMutableArray alloc] init]; 196 | NSNumber *itemID; 197 | NSString *itemLabel; 198 | NSString *itemCategory; 199 | NSNumber *itemLatitude; 200 | NSNumber *itemLongitude; 201 | NSString *itemDate; 202 | sqlite3 *dbPointer = [self getNewDBConnection]; 203 | sqlite3_stmt *statement = nil; 204 | 205 | NSString *sql_query = [NSString stringWithFormat:@"SELECT * FROM locationItems WHERE category='%@'", category]; 206 | const char *query_stmt = [sql_query UTF8String]; 207 | 208 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 209 | NSLog(@"Error preparing statement /getLastIDNumber/ %s", sqlite3_errmsg(dbPointer)); 210 | [categoryArray release]; 211 | return nil; 212 | } else { 213 | while(sqlite3_step(statement) == SQLITE_ROW) { 214 | 215 | itemID = [NSNumber numberWithInt:sqlite3_column_int(statement, 0)]; 216 | itemLabel = [NSString stringWithUTF8String:(const char *)sqlite3_column_text(statement, 1)]; 217 | itemCategory = [NSString stringWithUTF8String:(const char *)sqlite3_column_text(statement, 2)]; 218 | itemLatitude = [NSNumber numberWithFloat:(float)sqlite3_column_double(statement, 3)]; 219 | itemLongitude = [NSNumber numberWithFloat:(float)sqlite3_column_double(statement, 4)]; 220 | itemDate = [NSString stringWithUTF8String:(const char *)sqlite3_column_text(statement, 5)]; 221 | 222 | NSArray *itemData = [NSArray arrayWithObjects:itemID, itemLabel, itemCategory, itemLatitude, itemLongitude, itemDate, nil]; 223 | 224 | [categoryArray addObject:itemData]; 225 | } 226 | sqlite3_finalize(statement); 227 | sqlite3_close(dbPointer); 228 | dbPointer = nil; 229 | return [categoryArray autorelease]; 230 | } 231 | } 232 | 233 | -(BOOL)deleteItemWithID:(NSNumber *)ID { 234 | sqlite3 *dbPointer = [self getNewDBConnection]; 235 | sqlite3_stmt *statement = nil; 236 | BOOL success; 237 | NSString *sql_query = [NSString stringWithFormat:@"DELETE FROM locationItems WHERE id='%i'", [ID intValue]]; 238 | const char *query_stmt = [sql_query UTF8String]; 239 | if (sqlite3_prepare_v2(dbPointer, query_stmt, -1, &statement, NULL) != SQLITE_OK) { 240 | NSLog(@"Error preparing statement /addNewItem/ %s", sqlite3_errmsg(dbPointer)); 241 | success = NO; 242 | } else { 243 | if (sqlite3_step(statement)) { 244 | success = YES; 245 | } else { 246 | success = NO; 247 | } 248 | } 249 | 250 | sqlite3_finalize(statement); 251 | sqlite3_close(dbPointer); 252 | 253 | return success; 254 | } 255 | 256 | -(void)dealloc { 257 | [super dealloc]; 258 | } 259 | 260 | @end -------------------------------------------------------------------------------- /geoJoy/addItemViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // addItemViewController.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "addItemViewController.h" 10 | 11 | @implementation addItemViewController 12 | 13 | @synthesize itemLabel; 14 | @synthesize addDisplayLocationButton; 15 | @synthesize setCategoryButton; 16 | @synthesize loadingViewText; 17 | @synthesize loadingView, categoriesView, mapView, containerView; 18 | @synthesize map; 19 | @synthesize positionToBeSaved; 20 | @synthesize CLController; 21 | @synthesize model; 22 | 23 | // Custom, private functions in the backend 24 | 25 | -(void)checkForConnection { 26 | ConnectedClass *connection = [[ConnectedClass alloc] init]; 27 | 28 | if ([connection connected] == NO) { 29 | UIAlertView *alertDialog = [[UIAlertView alloc] initWithTitle:@"Internet Connection" message:@"This application requires an internet connection to work properly. Please activate either a WiFi or a cellular data connection." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 30 | [alertDialog show]; 31 | [alertDialog release]; 32 | } 33 | 34 | [connection release]; 35 | } 36 | 37 | -(void)showLoadingViewWithText:(NSString *)text { 38 | loadingViewText.text = text; 39 | [UIView beginAnimations:nil context:nil]; 40 | [UIView setAnimationDuration:0.5]; 41 | loadingView.alpha = 0.8; 42 | [UIView commitAnimations]; 43 | } 44 | 45 | -(void)dissapearLoadingView { 46 | [UIView beginAnimations:nil context:nil]; 47 | [UIView setAnimationDuration:0.5]; 48 | [UIView setAnimationDelay:0.7]; 49 | loadingView.alpha = 0; 50 | [UIView commitAnimations]; 51 | } 52 | 53 | -(void)loadDbAddLocation { 54 | [self showLoadingViewWithText:@"Saving item..."]; 55 | if ([model addNewItemWithName:itemLabel.text latitude:positionToBeSaved.coordinate.latitude longitude:positionToBeSaved.coordinate.longitude category:pickerString] == YES) { 56 | loadingViewText.text = @"Item saved!"; 57 | 58 | [categoriesPicker selectRow:0 inComponent:0 animated:NO]; 59 | itemLabel.text = @""; 60 | } else { 61 | UIAlertView *alertDialog = [[UIAlertView alloc] initWithTitle:@"Whoops!" message:@"There was a problem adding your location." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 62 | [alertDialog show]; 63 | [alertDialog release]; 64 | } 65 | 66 | [self dissapearLoadingView]; 67 | } 68 | 69 | -(void)textFieldFinished:(id)sender { 70 | [sender resignFirstResponder]; 71 | } 72 | 73 | -(IBAction)toggleToCategories { 74 | 75 | if (mapScreenOnTop == NO) { 76 | [setCategoryButton setTitle:@"Categories" forState:UIControlStateNormal]; 77 | mapScreenOnTop = YES; 78 | 79 | [self.itemLabel resignFirstResponder]; 80 | 81 | [UIView beginAnimations:nil context:self.view]; 82 | [UIView setAnimationDuration:0.5]; 83 | [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:containerView cache:YES]; 84 | [containerView bringSubviewToFront:mapView]; 85 | [UIView commitAnimations]; 86 | 87 | } else { 88 | [setCategoryButton setTitle:@"Map" forState:UIControlStateNormal]; 89 | mapScreenOnTop = NO; 90 | 91 | [self.itemLabel resignFirstResponder]; 92 | 93 | [UIView beginAnimations:nil context:self.view]; 94 | [UIView setAnimationDuration:0.5]; 95 | [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:containerView cache:YES]; 96 | [containerView bringSubviewToFront:categoriesView]; 97 | [UIView commitAnimations]; 98 | } 99 | } 100 | 101 | -(IBAction)addCurrentLocation { 102 | UIAlertView *alertDialog; 103 | 104 | if (mapScreenOnTop == NO) { 105 | [self toggleToCategories]; 106 | } 107 | 108 | if ([itemLabel.text isEqualToString:@""]) { 109 | alertDialog = [[UIAlertView alloc] initWithTitle:@"Whoops!" message:@"Item needs a label." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 110 | [alertDialog show]; 111 | [alertDialog release]; 112 | } else { 113 | [self loadDbAddLocation]; 114 | } 115 | } 116 | 117 | -(IBAction)updatelocation { 118 | [self showLoadingViewWithText:@"Locating..."]; 119 | [CLController.locMgr startUpdatingLocation]; 120 | updateLocationButton.enabled = NO; 121 | } 122 | 123 | -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { 124 | return 1; 125 | } 126 | 127 | -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { 128 | return [categories count]; 129 | } 130 | 131 | -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 132 | return [categories objectAtIndex:row]; 133 | } 134 | 135 | -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { 136 | pickerString = [categories objectAtIndex:row]; 137 | pickerValue = row; 138 | } 139 | 140 | -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation { 141 | MKPinAnnotationView *pinDrop = (MKPinAnnotationView *)[map dequeueReusableAnnotationViewWithIdentifier:@"current"]; 142 | if (pinDrop == nil) { 143 | pinDrop = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"current"] autorelease]; 144 | pinDrop.pinColor = MKPinAnnotationColorPurple; 145 | pinDrop.canShowCallout = YES; 146 | pinDrop.animatesDrop = NO; 147 | } else { 148 | pinDrop.annotation = annotation; 149 | } 150 | return pinDrop; 151 | } 152 | 153 | -(void)locationUpdate:(CLLocation *)location { 154 | if (location.horizontalAccuracy >= 0) { 155 | NSArray *annotationsArray = [NSArray arrayWithArray:[map annotations]]; 156 | MKCoordinateRegion mapRegion; 157 | 158 | [addDisplayLocationButton setEnabled:TRUE]; 159 | 160 | mapRegion.center = location.coordinate; 161 | mapRegion.span.latitudeDelta = 0.005; 162 | mapRegion.span.longitudeDelta = 0.005; 163 | 164 | [map setRegion:mapRegion animated:YES]; 165 | 166 | if (positionToBeSaved == nil || (positionToBeSaved.coordinate.latitude != location.coordinate.latitude || positionToBeSaved.coordinate.longitude != location.coordinate.longitude)) { 167 | positionToBeSaved = [[CLLocation alloc] initWithLatitude:location.coordinate.latitude longitude:location.coordinate.longitude]; 168 | [map addAnnotation:[[[annotationsController alloc] initWithTitle:@"This is you" subtitle:@"Use the reolad button to update your location." coordinate:location.coordinate] autorelease]]; 169 | if ([annotationsArray count] > 0) { 170 | [map removeAnnotations:annotationsArray]; 171 | } 172 | [CLController.locMgr stopUpdatingLocation]; 173 | updateLocationButton.enabled = YES; 174 | [self dissapearLoadingView]; 175 | } 176 | } 177 | } 178 | 179 | -(void)locationError:(NSError *)error { 180 | UIAlertView *alertDialog; 181 | 182 | [self dissapearLoadingView]; 183 | 184 | NSString *errorMessage; 185 | 186 | if (error.code == kCLErrorDenied) { 187 | errorMessage = @"The application needs location services to work properly. They are currently disabled for geoJoy."; 188 | } else if (error.code == kCLErrorLocationUnknown) { 189 | errorMessage = @"There has been a problem while trying to get your location. Please try again."; 190 | } else if (error.code == kCLErrorNetwork) { 191 | errorMessage = @"The location device has returned an error of unavailable or disabled network. Please make sure your location device is working properly."; 192 | } else { 193 | errorMessage = @"There has been an unknown error while trying to get your location. Please try again."; 194 | } 195 | 196 | alertDialog = [[UIAlertView alloc] initWithTitle:@"Location Error" message:errorMessage delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 197 | [alertDialog show]; 198 | [alertDialog release]; 199 | } 200 | 201 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 202 | { 203 | // Return YES for supported orientations 204 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 205 | } 206 | 207 | - (void)didReceiveMemoryWarning 208 | { 209 | // Releases the view if it doesn't have a superview. 210 | 211 | [super didReceiveMemoryWarning]; 212 | 213 | // Release any cached data, images, etc. that aren't in use. 214 | } 215 | 216 | -(void)viewWillAppear:(BOOL)animated { 217 | [self checkForConnection]; 218 | [super viewWillAppear:animated]; 219 | } 220 | 221 | 222 | - (void)viewDidUnload 223 | { 224 | [CLController release]; 225 | [model release]; 226 | 227 | self.mapView = nil; 228 | self.loadingView = nil; 229 | self.categoriesView = nil; 230 | self.containerView = nil; 231 | 232 | [super viewDidUnload]; 233 | 234 | // Release any retained subviews of the main view. 235 | // e.g. self.myOutlet = nil; 236 | } 237 | 238 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 239 | - (void)viewDidLoad { 240 | [self showLoadingViewWithText:@"Locating..."]; 241 | [self.itemLabel setReturnKeyType:UIReturnKeyDone]; 242 | [self.itemLabel addTarget:self 243 | action:@selector(textFieldFinished:) 244 | forControlEvents:UIControlEventEditingDidEndOnExit]; 245 | 246 | CLController = [[CLLocationController alloc] init]; 247 | CLController.delegate = self; 248 | 249 | model = [[dbModel alloc] init]; 250 | 251 | updateLocationButton.enabled = YES; 252 | 253 | mapScreenOnTop = YES; 254 | 255 | categories = [[NSArray alloc] initWithObjects:@"Arts & Crafts", @"Education", @"Entertainment", @"Family", @"Food", @"Friends", @"Landscape & View", @"Museum", @"Party", @"Professional", @"Shopping", @"Technology", @"Other", nil]; 256 | 257 | pickerString = [categories objectAtIndex:0]; 258 | pickerValue = 0; 259 | 260 | [super viewDidLoad]; 261 | } 262 | 263 | -(void)dealloc { 264 | [itemLabel release]; 265 | [addDisplayLocationButton release]; 266 | [setCategoryButton release]; 267 | [map release]; 268 | [loadingView release]; 269 | [categoriesView release]; 270 | [mapView release]; 271 | [containerView release]; 272 | [categories release]; 273 | [pickerString release]; 274 | [positionToBeSaved release]; 275 | [CLController release]; 276 | [model release]; 277 | [super dealloc]; 278 | } 279 | 280 | @end -------------------------------------------------------------------------------- /geoJoy/itemsListViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // itemsListViewController.m 3 | // geoJoy 4 | // 5 | // Created by Jakob Hans Renpening on 22/08/11. 6 | // Copyright 2011 Claim Soluciones, S.C.P. All rights reserved. 7 | // 8 | 9 | #import "itemsListViewController.h" 10 | 11 | @implementation itemsListViewController 12 | 13 | @synthesize pickerValue, geoItemsCount, categoriesCount; 14 | @synthesize categories; 15 | @synthesize categoriesTitles, itemsData, selectedItem; 16 | @synthesize detailsView, theTableView, detailsEditView, detailsMapView; 17 | @synthesize itemsCountLabel; 18 | @synthesize generalEditButton, backToList; 19 | @synthesize editItemLabel; 20 | @synthesize editSaveItem; 21 | @synthesize itemsTable; 22 | @synthesize detailMap; 23 | @synthesize editCategoriesPicker; 24 | @synthesize CLControllerSecondView; 25 | @synthesize model; 26 | 27 | -(void)checkForConnection { 28 | ConnectedClass *connection = [[ConnectedClass alloc] init]; 29 | 30 | if ([connection connected] == NO) { 31 | UIAlertView *alertDialog = [[UIAlertView alloc] initWithTitle:@"Internet Connection" message:@"This application needs an internet connection to work properly. Please activate either a WiFi or a cellular data connection." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 32 | [alertDialog show]; 33 | [alertDialog release]; 34 | } 35 | 36 | [connection release]; 37 | } 38 | 39 | -(void)textFieldFinished:(id)sender { 40 | [sender resignFirstResponder]; 41 | } 42 | 43 | -(void)setEditItemValues { 44 | editItemLabel.text = [selectedItem objectAtIndex:1]; 45 | NSInteger categoryIndex = [categories indexOfObject:[selectedItem objectAtIndex:2]]; 46 | [editCategoriesPicker selectRow:categoryIndex inComponent:0 animated:NO]; 47 | pickerString = [selectedItem objectAtIndex:2]; 48 | pickerValue = categoryIndex; 49 | } 50 | 51 | -(void)toggleWithinDetailsMapWithEdit { 52 | if (withinDetailsMapIsOnTop == NO) { 53 | withinDetailsMapIsOnTop = YES; 54 | 55 | [UIView beginAnimations:nil context:detailsView]; 56 | [UIView setAnimationDuration:0.5]; 57 | [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:detailsView cache:YES]; 58 | [detailsView bringSubviewToFront:detailsMapView]; 59 | [UIView commitAnimations]; 60 | 61 | [CLControllerSecondView.locMgr startUpdatingLocation]; 62 | 63 | generalEditButton.title = @"Edit"; 64 | } else { 65 | withinDetailsMapIsOnTop = NO; 66 | 67 | [UIView beginAnimations:nil context:detailsView]; 68 | [UIView setAnimationDuration:0.5]; 69 | [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:detailsView cache:YES]; 70 | [detailsView bringSubviewToFront:detailsEditView]; 71 | [UIView commitAnimations]; 72 | 73 | [CLControllerSecondView.locMgr stopUpdatingLocation]; 74 | 75 | generalEditButton.title = @"Cancel"; 76 | } 77 | } 78 | 79 | -(void)toggleTableWithDetails { 80 | if (tableViewIsOnTop == NO) { 81 | 82 | backToList.enabled = NO; 83 | tableViewIsOnTop = YES; 84 | 85 | [UIView beginAnimations:nil context:self.view]; 86 | [UIView setAnimationDuration:0.5]; 87 | [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES]; 88 | [self.view bringSubviewToFront:theTableView]; 89 | [UIView commitAnimations]; 90 | 91 | if (withinDetailsMapIsOnTop == NO) { 92 | [self toggleWithinDetailsMapWithEdit]; 93 | } 94 | 95 | [CLControllerSecondView.locMgr stopUpdatingLocation]; 96 | 97 | } else { 98 | 99 | backToList.enabled = YES; 100 | tableViewIsOnTop = NO; 101 | 102 | [UIView beginAnimations:nil context:self.view]; 103 | [UIView setAnimationDuration:0.5]; 104 | [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; 105 | [self.view bringSubviewToFront:detailsView]; 106 | [UIView commitAnimations]; 107 | 108 | [CLControllerSecondView.locMgr startUpdatingLocation]; 109 | 110 | } 111 | } 112 | 113 | -(void)editTableItems { 114 | [self setEditing:YES animated:YES]; 115 | } 116 | 117 | -(void)loadTableData { 118 | // Getting Categories Count 119 | categoriesCount = [model getCategoriesNumber:categories]; 120 | 121 | // Getting Categories Titles that have at least one item each 122 | categoriesTitles = [[NSMutableArray alloc] initWithCapacity:categoriesCount]; 123 | for (NSString *category in categories) { 124 | int categoryCount = [model getItemsCountByCategory:category]; 125 | if (categoryCount > 0) { 126 | [categoriesTitles addObject:category]; 127 | } 128 | } 129 | 130 | // Getting item's data by Category 131 | itemsData = [[NSMutableArray alloc] init]; 132 | NSMutableArray *sectionData; 133 | for (NSString *category in categoriesTitles) { 134 | sectionData = [[NSMutableArray alloc] initWithArray:[model getAllItemsByCategory:category]]; 135 | [itemsData addObject:sectionData]; 136 | [sectionData release]; 137 | } 138 | [itemsData retain]; 139 | } 140 | 141 | -(void)reloadItemsCounter { 142 | geoItemsCount = [model getNumberOfItemsInTable]; 143 | NSString *labelMessage; 144 | if (geoItemsCount == 0) { 145 | itemsTable.hidden = YES; 146 | labelMessage = [[NSString alloc]initWithString:@"No items saved"]; 147 | generalEditButton.enabled = NO; 148 | } else { 149 | [self loadTableData]; 150 | itemsTable.hidden = NO; 151 | if (geoItemsCount == 1) { 152 | labelMessage = [[NSString alloc]initWithString:@"1 item"]; 153 | } else { 154 | labelMessage = [[NSString alloc]initWithFormat:@"%i items", geoItemsCount]; 155 | } 156 | generalEditButton.enabled = YES; 157 | } 158 | itemsCountLabel.text = labelMessage; 159 | [labelMessage release]; 160 | } 161 | 162 | -(IBAction)saveEditedItem { 163 | if ([model updateItemWithID:[selectedItem objectAtIndex:0] toName:editItemLabel.text andCategory:pickerString] == YES) { 164 | [self loadTableData]; 165 | [itemsTable reloadData]; 166 | [self toggleWithinDetailsMapWithEdit]; 167 | [self toggleTableWithDetails]; 168 | } 169 | 170 | } 171 | 172 | -(IBAction)editButtonPressed { 173 | if (tableViewIsOnTop == YES) { 174 | if (editingTable == NO) { 175 | [self editTableItems]; 176 | } else { 177 | [self setEditing:NO animated:YES]; 178 | } 179 | } else { 180 | [self setEditItemValues]; 181 | [self toggleWithinDetailsMapWithEdit]; 182 | } 183 | } 184 | 185 | -(IBAction)backToListButtonPressed { 186 | [self toggleTableWithDetails]; 187 | } 188 | 189 | -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { 190 | return 1; 191 | } 192 | 193 | -(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { 194 | return [categories count]; 195 | } 196 | 197 | -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 198 | return [categories objectAtIndex:row]; 199 | } 200 | 201 | -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { 202 | pickerString = [categories objectAtIndex:row]; 203 | pickerValue = row; 204 | } 205 | 206 | // Start Map Stuff 207 | 208 | -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation { 209 | [detailMap dequeueReusableAnnotationViewWithIdentifier:@"currentItem"]; 210 | 211 | if ([annotation isKindOfClass:[MKUserLocation class]]) { 212 | MKPinAnnotationView *userLocation = (MKPinAnnotationView *)[detailMap dequeueReusableAnnotationViewWithIdentifier:@"userLocationForItem"]; 213 | return userLocation; 214 | } 215 | 216 | MKPinAnnotationView *pinDrop = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentItem"] autorelease]; 217 | pinDrop.pinColor = MKPinAnnotationColorPurple; 218 | pinDrop.canShowCallout = YES; 219 | pinDrop.animatesDrop = YES; 220 | 221 | return pinDrop; 222 | } 223 | 224 | // End Map Stuff 225 | 226 | -(void)loadItemsDataInDetails { 227 | NSMutableArray *presentAnnotations = [NSMutableArray arrayWithArray:[detailMap annotations]]; 228 | for (MKPinAnnotationView *annotation in presentAnnotations) { 229 | if ([annotation isKindOfClass:[MKUserLocation class]]) { 230 | [presentAnnotations removeObject:annotation]; 231 | } 232 | } 233 | 234 | [detailMap removeAnnotations:presentAnnotations]; 235 | 236 | [self toggleTableWithDetails]; 237 | 238 | MKCoordinateRegion mapRegion; 239 | CLLocationCoordinate2D itemCoordinates; 240 | 241 | itemCoordinates.latitude = (CLLocationDegrees)[[selectedItem objectAtIndex:3] doubleValue]; 242 | itemCoordinates.longitude = (CLLocationDegrees)[[selectedItem objectAtIndex:4] doubleValue]; 243 | 244 | mapRegion.center = itemCoordinates; 245 | mapRegion.span.latitudeDelta = 0.01; 246 | mapRegion.span.longitudeDelta = 0.01; 247 | 248 | [detailMap setRegion:mapRegion]; 249 | 250 | annotationsController *itemLocationPin = [[annotationsController alloc] initWithTitle:[selectedItem objectAtIndex:1] subtitle:[selectedItem objectAtIndex:2] coordinate:itemCoordinates]; 251 | 252 | [detailMap addAnnotation:itemLocationPin]; 253 | 254 | [itemLocationPin release]; 255 | } 256 | 257 | // Table Stuff 258 | 259 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 260 | return [itemsData count]; 261 | } 262 | 263 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 264 | return [[itemsData objectAtIndex:section] count]; 265 | } 266 | 267 | 268 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 269 | return [categoriesTitles objectAtIndex:section]; 270 | } 271 | 272 | 273 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 274 | static NSString *CellIdentifier = @"Cell"; 275 | UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"Cell"]; 276 | 277 | if (cell == nil) { 278 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 279 | } 280 | [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 281 | [[cell textLabel] setText:[[[itemsData objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectAtIndex:1]]; 282 | 283 | return cell; 284 | } 285 | 286 | -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { 287 | cell.backgroundColor = [UIColor whiteColor]; 288 | } 289 | 290 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 291 | 292 | if (selectedItem != nil) { 293 | [selectedItem removeAllObjects]; 294 | selectedItem = [[NSMutableArray arrayWithArray:[[itemsData objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]] retain]; 295 | } else { 296 | selectedItem = [[NSMutableArray alloc] initWithArray:[[itemsData objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]]; 297 | } 298 | 299 | [self loadItemsDataInDetails]; 300 | } 301 | 302 | - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { 303 | return UITableViewCellEditingStyleDelete; 304 | } 305 | 306 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 307 | if (editingStyle == UITableViewCellEditingStyleDelete) 308 | { 309 | 310 | NSNumber *itemID = [[[itemsData objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectAtIndex:0]; 311 | if ([model deleteItemWithID:itemID] == YES) { 312 | [[itemsData objectAtIndex:indexPath.section] removeObjectAtIndex:indexPath.row]; 313 | [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationRight]; 314 | if ([[itemsData objectAtIndex:indexPath.section] count] == 0) { 315 | [categoriesTitles removeObjectAtIndex:indexPath.section]; 316 | [itemsData removeObjectAtIndex:indexPath.section]; 317 | [tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationFade]; 318 | } 319 | [self reloadItemsCounter]; 320 | } else { 321 | NSLog(@"There has been a problem while deleting an item."); 322 | } 323 | } 324 | } 325 | 326 | -(void)setEditing:(BOOL)editing animated:(BOOL)animated { 327 | [super setEditing:editing animated:animated]; 328 | [itemsTable setEditing:editing animated:animated]; 329 | 330 | if (editing == NO) { 331 | editingTable = NO; 332 | generalEditButton.title = @"Edit"; 333 | } else if (editing == YES) { 334 | editingTable = YES; 335 | [generalEditButton setTitle:@"Cancel"]; 336 | } 337 | } 338 | 339 | -(void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath { 340 | if (geoItemsCount == 0) { 341 | [self setEditing:NO animated:NO]; 342 | } 343 | } 344 | 345 | // End Table Stuff 346 | 347 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 348 | { 349 | // Return YES for supported orientations 350 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 351 | } 352 | 353 | - (void)didReceiveMemoryWarning 354 | { 355 | // Releases the view if it doesn't have a superview. 356 | [super didReceiveMemoryWarning]; 357 | 358 | // Release any cached data, images, etc. that aren't in use. 359 | } 360 | 361 | -(void)viewWillAppear:(BOOL)animated { 362 | [self reloadItemsCounter]; 363 | 364 | [itemsTable reloadData]; 365 | 366 | UIView *tableBottomSpace = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; 367 | itemsTable.tableFooterView = tableBottomSpace; 368 | 369 | [tableBottomSpace release]; 370 | 371 | [CLControllerSecondView.locMgr startUpdatingLocation]; 372 | 373 | if (withinDetailsMapIsOnTop == NO) { 374 | [self toggleWithinDetailsMapWithEdit]; 375 | } 376 | 377 | if (tableViewIsOnTop == NO) { 378 | [self toggleTableWithDetails]; 379 | } 380 | 381 | [self checkForConnection]; 382 | 383 | [super viewWillAppear:animated]; 384 | } 385 | 386 | -(void)viewWillDisappear:(BOOL)animated { 387 | [CLControllerSecondView.locMgr stopUpdatingLocation]; 388 | [super viewWillDisappear:animated]; 389 | } 390 | 391 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 392 | - (void)viewDidLoad 393 | { 394 | model = [[dbModel alloc] init]; 395 | 396 | tableViewIsOnTop = YES; 397 | withinDetailsMapIsOnTop = YES; 398 | editingTable = NO; 399 | 400 | CLControllerSecondView = [[CLLocationController alloc] init]; 401 | CLControllerSecondView.delegate = self; 402 | 403 | backToList.enabled = NO; 404 | 405 | categories = [[NSArray alloc] initWithObjects:@"Arts & Crafts", @"Education", @"Entertainment", @"Family", @"Food", @"Friends", @"Landscape & View", @"Museum", @"Party", @"Professional", @"Shopping", @"Technology", @"Other", nil]; 406 | 407 | [self.editItemLabel setReturnKeyType:UIReturnKeyDone]; 408 | [self.editItemLabel addTarget:self 409 | action:@selector(textFieldFinished:) 410 | forControlEvents:UIControlEventEditingDidEndOnExit]; 411 | [super viewDidLoad]; 412 | } 413 | 414 | - (void)viewDidUnload 415 | { 416 | [CLControllerSecondView release]; 417 | [model release]; 418 | 419 | self.theTableView = nil; 420 | self.detailsView = nil; 421 | self.detailsMapView = nil; 422 | self.detailsEditView = nil; 423 | 424 | [super viewDidUnload]; 425 | 426 | // Release any retained subviews of the main view. 427 | // e.g. self.myOutlet = nil; 428 | } 429 | 430 | 431 | -(void)dealloc { 432 | [categories release]; 433 | [categoriesTitles release]; 434 | [itemsData release]; 435 | [selectedItem release]; 436 | [detailsView release]; 437 | [detailsMapView release]; 438 | [detailsEditView release]; 439 | [theTableView release]; 440 | [generalEditButton release]; 441 | [backToList release]; 442 | [editItemLabel release]; 443 | [editSaveItem release]; 444 | [itemsCountLabel release]; 445 | [itemsTable release]; 446 | [detailMap release]; 447 | [editCategoriesPicker release]; 448 | [CLControllerSecondView release]; 449 | [model release]; 450 | [super dealloc]; 451 | } 452 | 453 | @end 454 | -------------------------------------------------------------------------------- /geoJoy/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUITabBarItem 17 | IBUIViewController 18 | IBUICustomObject 19 | IBUITabBarController 20 | IBUIWindow 21 | IBUITabBar 22 | 23 | 24 | YES 25 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 26 | 27 | 28 | PluginDependencyRecalculationVersion 29 | 30 | 31 | 32 | YES 33 | 34 | IBFilesOwner 35 | IBCocoaTouchFramework 36 | 37 | 38 | IBFirstResponder 39 | IBCocoaTouchFramework 40 | 41 | 42 | IBCocoaTouchFramework 43 | 44 | 45 | 46 | 1316 47 | 48 | {320, 480} 49 | 50 | 51 | 52 | 1 53 | MSAxIDEAA 54 | 55 | NO 56 | NO 57 | 58 | 2 59 | 60 | IBCocoaTouchFramework 61 | YES 62 | 63 | 64 | 65 | 66 | 67 | 1 68 | 1 69 | 70 | IBCocoaTouchFramework 71 | NO 72 | 73 | 74 | 3 75 | 3 76 | 3 77 | 3 78 | IBCocoaTouchFramework 79 | 0 80 | 81 | 82 | moreInfoView 83 | 84 | 85 | 1 86 | 1 87 | 88 | IBCocoaTouchFramework 89 | NO 90 | 91 | 92 | YES 93 | 94 | 95 | Location 96 | 97 | NSImage 98 | position.png 99 | 100 | IBCocoaTouchFramework 101 | 102 | 103 | addItemView 104 | 105 | 1 106 | 1 107 | 108 | IBCocoaTouchFramework 109 | NO 110 | 111 | 112 | 113 | Saved Places 114 | 115 | NSImage 116 | bookmark.png 117 | 118 | 3 119 | 3 120 | 3 121 | 3 122 | IBCocoaTouchFramework 123 | 124 | 125 | itemsListView 126 | 127 | 1 128 | 1 129 | 130 | IBCocoaTouchFramework 131 | NO 132 | 133 | 134 | 135 | 136 | 137 | 266 138 | {{0, 431}, {320, 49}} 139 | 140 | 141 | 142 | 3 143 | MAA 144 | 145 | NO 146 | IBCocoaTouchFramework 147 | 148 | 149 | 150 | 151 | 152 | YES 153 | 154 | 155 | delegate 156 | 157 | 158 | 159 | 99 160 | 161 | 162 | 163 | rootViewController 164 | 165 | 166 | 167 | 138 168 | 169 | 170 | 171 | window 172 | 173 | 174 | 175 | 9 176 | 177 | 178 | 179 | tabBarController 180 | 181 | 182 | 183 | 113 184 | 185 | 186 | 187 | 188 | YES 189 | 190 | 0 191 | 192 | YES 193 | 194 | 195 | 196 | 197 | 198 | 2 199 | 200 | 201 | YES 202 | 203 | 204 | 205 | 206 | -1 207 | 208 | 209 | File's Owner 210 | 211 | 212 | 3 213 | 214 | 215 | 216 | 217 | 106 218 | 219 | 220 | YES 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 107 230 | 231 | 232 | 233 | 234 | 108 235 | 236 | 237 | YES 238 | 239 | 240 | 241 | 242 | 243 | 109 244 | 245 | 246 | YES 247 | 248 | 249 | 250 | 251 | 252 | 110 253 | 254 | 255 | 256 | 257 | 111 258 | 259 | 260 | 261 | 262 | -2 263 | 264 | 265 | 266 | 267 | 125 268 | 269 | 270 | YES 271 | 272 | 273 | 274 | 275 | 276 | 126 277 | 278 | 279 | 280 | 281 | 282 | 283 | YES 284 | 285 | YES 286 | -1.CustomClassName 287 | -1.IBPluginDependency 288 | -2.CustomClassName 289 | -2.IBPluginDependency 290 | 106.IBPluginDependency 291 | 107.IBPluginDependency 292 | 108.CustomClassName 293 | 108.IBPluginDependency 294 | 109.CustomClassName 295 | 109.IBPluginDependency 296 | 110.IBPluginDependency 297 | 111.IBPluginDependency 298 | 125.CustomClassName 299 | 125.IBPluginDependency 300 | 126.IBPluginDependency 301 | 2.IBAttributePlaceholdersKey 302 | 2.IBPluginDependency 303 | 3.CustomClassName 304 | 3.IBPluginDependency 305 | 306 | 307 | YES 308 | UIApplication 309 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 310 | UIResponder 311 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 312 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 313 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 314 | addItemViewController 315 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 316 | itemsListViewController 317 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 318 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 319 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 320 | moreInfoViewController 321 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 322 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 323 | 324 | YES 325 | 326 | 327 | 328 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 329 | geoJoyAppDelegate 330 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 331 | 332 | 333 | 334 | YES 335 | 336 | 337 | 338 | 339 | 340 | YES 341 | 342 | 343 | 344 | 345 | 138 346 | 347 | 348 | 0 349 | IBCocoaTouchFramework 350 | 351 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 352 | 353 | 354 | YES 355 | 3 356 | 357 | YES 358 | 359 | YES 360 | bookmark.png 361 | position.png 362 | 363 | 364 | YES 365 | {32, 32} 366 | {32, 32} 367 | 368 | 369 | 933 370 | 371 | 372 | -------------------------------------------------------------------------------- /geoJoy.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4206A136142DE9AE0023DBB0 /* dbModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4206A135142DE9AE0023DBB0 /* dbModel.m */; }; 11 | 421D9ABF1435DF5000ABA55D /* logoClaim.png in Resources */ = {isa = PBXBuildFile; fileRef = 421D9ABE1435DF5000ABA55D /* logoClaim.png */; }; 12 | 424853CE14443C5500622402 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 424853CD14443C5500622402 /* Reachability.m */; }; 13 | 424853D114443DD800622402 /* ConnectedClass.m in Sources */ = {isa = PBXBuildFile; fileRef = 424853D014443DD800622402 /* ConnectedClass.m */; }; 14 | 424853D214443DEA00622402 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 426A1933143CD50E00CD1A1F /* SystemConfiguration.framework */; }; 15 | 42668AB71434CDAC0084C261 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 42668AB61434CDAC0084C261 /* icon@2x.png */; }; 16 | 42668AB91434CDBE0084C261 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 42668AB81434CDBE0084C261 /* Icon.png */; }; 17 | 426E268D14052BFC00C47A26 /* bookmark.png in Resources */ = {isa = PBXBuildFile; fileRef = 426E268B14052BFC00C47A26 /* bookmark.png */; }; 18 | 426E268E14052BFC00C47A26 /* bookmark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 426E268C14052BFC00C47A26 /* bookmark@2x.png */; }; 19 | 4270BB4F142F41EB00A39CC0 /* position.png in Resources */ = {isa = PBXBuildFile; fileRef = 4270BB4D142F41EB00A39CC0 /* position.png */; }; 20 | 4270BB50142F41EB00A39CC0 /* position@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4270BB4E142F41EB00A39CC0 /* position@2x.png */; }; 21 | 4270BB52142F4C9000A39CC0 /* geojoy.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = 4270BB51142F4C9000A39CC0 /* geojoy.sqlite */; }; 22 | 42AA471C1435E5C7006D090D /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 42AA471B1435E5C7006D090D /* Default.png */; }; 23 | 42AA471F1435E5CC006D090D /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 42AA471E1435E5CC006D090D /* Default@2x.png */; }; 24 | 42B350FD142CA0390099924E /* app_title.png in Resources */ = {isa = PBXBuildFile; fileRef = 42B350FB142CA0390099924E /* app_title.png */; }; 25 | 42B350FE142CA0390099924E /* app_title@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 42B350FC142CA0390099924E /* app_title@2x.png */; }; 26 | 42C589D61402C9D2005D259D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C589D51402C9D2005D259D /* UIKit.framework */; }; 27 | 42C589D81402C9D2005D259D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C589D71402C9D2005D259D /* Foundation.framework */; }; 28 | 42C589DA1402C9D2005D259D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C589D91402C9D2005D259D /* CoreGraphics.framework */; }; 29 | 42C589E01402C9D2005D259D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 42C589DE1402C9D2005D259D /* InfoPlist.strings */; }; 30 | 42C589E21402C9D2005D259D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 42C589E11402C9D2005D259D /* main.m */; }; 31 | 42C589E61402C9D2005D259D /* geoJoyAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 42C589E51402C9D2005D259D /* geoJoyAppDelegate.m */; }; 32 | 42C589E91402C9D2005D259D /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42C589E71402C9D2005D259D /* MainWindow.xib */; }; 33 | 42C589EC1402C9D2005D259D /* addItemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42C589EB1402C9D2005D259D /* addItemViewController.m */; }; 34 | 42C589EF1402C9D2005D259D /* itemsListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42C589EE1402C9D2005D259D /* itemsListViewController.m */; }; 35 | 42C589F21402C9D2005D259D /* addItemView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42C589F01402C9D2005D259D /* addItemView.xib */; }; 36 | 42C589F51402C9D2005D259D /* itemsListView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42C589F31402C9D2005D259D /* itemsListView.xib */; }; 37 | 42C58A161402C9E9005D259D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C58A151402C9E9005D259D /* CoreLocation.framework */; }; 38 | 42C58A181402C9F0005D259D /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42C58A171402C9F0005D259D /* MapKit.framework */; }; 39 | 42C58A1C1402CA42005D259D /* moreInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42C58A1A1402CA42005D259D /* moreInfoViewController.m */; }; 40 | 42C58A1D1402CA42005D259D /* moreInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42C58A1B1402CA42005D259D /* moreInfoView.xib */; }; 41 | 42CFDC2A142E825300ABC9C8 /* annotationsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42CFDC29142E825300ABC9C8 /* annotationsController.m */; }; 42 | 42CFDC2D142E836D00ABC9C8 /* CLLocationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42CFDC2C142E836D00ABC9C8 /* CLLocationController.m */; }; 43 | 42FB0AB8142CDE0600E79FD9 /* libsqlite3.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 42FB0AB7142CDE0600E79FD9 /* libsqlite3.0.dylib */; }; 44 | /* End PBXBuildFile section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 4206A134142DE9AE0023DBB0 /* dbModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dbModel.h; sourceTree = ""; }; 48 | 4206A135142DE9AE0023DBB0 /* dbModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = dbModel.m; sourceTree = ""; }; 49 | 421D9ABE1435DF5000ABA55D /* logoClaim.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logoClaim.png; sourceTree = ""; }; 50 | 424853CC14443C5500622402 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; 51 | 424853CD14443C5500622402 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; 52 | 424853CF14443DD800622402 /* ConnectedClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectedClass.h; sourceTree = ""; }; 53 | 424853D014443DD800622402 /* ConnectedClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectedClass.m; sourceTree = ""; }; 54 | 42668AB61434CDAC0084C261 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "../icon@2x.png"; sourceTree = ""; }; 55 | 42668AB81434CDBE0084C261 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../Icon.png; sourceTree = ""; }; 56 | 426A1933143CD50E00CD1A1F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 57 | 426E268B14052BFC00C47A26 /* bookmark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bookmark.png; sourceTree = ""; }; 58 | 426E268C14052BFC00C47A26 /* bookmark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bookmark@2x.png"; sourceTree = ""; }; 59 | 4270BB4D142F41EB00A39CC0 /* position.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = position.png; sourceTree = ""; }; 60 | 4270BB4E142F41EB00A39CC0 /* position@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "position@2x.png"; sourceTree = ""; }; 61 | 4270BB51142F4C9000A39CC0 /* geojoy.sqlite */ = {isa = PBXFileReference; lastKnownFileType = file; path = geojoy.sqlite; sourceTree = ""; }; 62 | 42AA471B1435E5C7006D090D /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = ../Default.png; sourceTree = ""; }; 63 | 42AA471E1435E5CC006D090D /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "../Default@2x.png"; sourceTree = ""; }; 64 | 42B350FB142CA0390099924E /* app_title.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = app_title.png; sourceTree = ""; }; 65 | 42B350FC142CA0390099924E /* app_title@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "app_title@2x.png"; sourceTree = ""; }; 66 | 42C589D11402C9D2005D259D /* geoJoy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = geoJoy.app; sourceTree = BUILT_PRODUCTS_DIR; }; 67 | 42C589D51402C9D2005D259D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 68 | 42C589D71402C9D2005D259D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 69 | 42C589D91402C9D2005D259D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 70 | 42C589DD1402C9D2005D259D /* geoJoy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "geoJoy-Info.plist"; sourceTree = ""; }; 71 | 42C589DF1402C9D2005D259D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 72 | 42C589E11402C9D2005D259D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 73 | 42C589E31402C9D2005D259D /* geoJoy-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "geoJoy-Prefix.pch"; sourceTree = ""; }; 74 | 42C589E41402C9D2005D259D /* geoJoyAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = geoJoyAppDelegate.h; sourceTree = ""; }; 75 | 42C589E51402C9D2005D259D /* geoJoyAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = geoJoyAppDelegate.m; sourceTree = ""; }; 76 | 42C589E81402C9D2005D259D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 77 | 42C589EA1402C9D2005D259D /* addItemViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = addItemViewController.h; sourceTree = ""; }; 78 | 42C589EB1402C9D2005D259D /* addItemViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = addItemViewController.m; sourceTree = ""; }; 79 | 42C589ED1402C9D2005D259D /* itemsListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = itemsListViewController.h; sourceTree = ""; }; 80 | 42C589EE1402C9D2005D259D /* itemsListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = itemsListViewController.m; sourceTree = ""; }; 81 | 42C589F11402C9D2005D259D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/addItemView.xib; sourceTree = ""; }; 82 | 42C589F41402C9D2005D259D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/itemsListView.xib; sourceTree = ""; }; 83 | 42C589FC1402C9D2005D259D /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 84 | 42C58A051402C9D2005D259D /* geoJoyTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "geoJoyTests-Info.plist"; sourceTree = ""; }; 85 | 42C58A071402C9D2005D259D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 86 | 42C58A091402C9D2005D259D /* geoJoyTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = geoJoyTests.h; sourceTree = ""; }; 87 | 42C58A0B1402C9D2005D259D /* geoJoyTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = geoJoyTests.m; sourceTree = ""; }; 88 | 42C58A151402C9E9005D259D /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 89 | 42C58A171402C9F0005D259D /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 90 | 42C58A191402CA42005D259D /* moreInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = moreInfoViewController.h; sourceTree = ""; }; 91 | 42C58A1A1402CA42005D259D /* moreInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = moreInfoViewController.m; sourceTree = ""; }; 92 | 42C58A1B1402CA42005D259D /* moreInfoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = moreInfoView.xib; sourceTree = ""; }; 93 | 42CFDC28142E825300ABC9C8 /* annotationsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = annotationsController.h; sourceTree = ""; }; 94 | 42CFDC29142E825300ABC9C8 /* annotationsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = annotationsController.m; sourceTree = ""; }; 95 | 42CFDC2B142E836D00ABC9C8 /* CLLocationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLLocationController.h; sourceTree = ""; }; 96 | 42CFDC2C142E836D00ABC9C8 /* CLLocationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLLocationController.m; sourceTree = ""; }; 97 | 42FB0AB7142CDE0600E79FD9 /* libsqlite3.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.0.dylib; path = usr/lib/libsqlite3.0.dylib; sourceTree = SDKROOT; }; 98 | /* End PBXFileReference section */ 99 | 100 | /* Begin PBXFrameworksBuildPhase section */ 101 | 42C589CE1402C9D2005D259D /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | 424853D214443DEA00622402 /* SystemConfiguration.framework in Frameworks */, 106 | 42FB0AB8142CDE0600E79FD9 /* libsqlite3.0.dylib in Frameworks */, 107 | 42C58A181402C9F0005D259D /* MapKit.framework in Frameworks */, 108 | 42C58A161402C9E9005D259D /* CoreLocation.framework in Frameworks */, 109 | 42C589D61402C9D2005D259D /* UIKit.framework in Frameworks */, 110 | 42C589D81402C9D2005D259D /* Foundation.framework in Frameworks */, 111 | 42C589DA1402C9D2005D259D /* CoreGraphics.framework in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | /* End PBXFrameworksBuildPhase section */ 116 | 117 | /* Begin PBXGroup section */ 118 | 4206A137142DE9B60023DBB0 /* General Classes */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 424853CC14443C5500622402 /* Reachability.h */, 122 | 424853CD14443C5500622402 /* Reachability.m */, 123 | 4206A134142DE9AE0023DBB0 /* dbModel.h */, 124 | 4206A135142DE9AE0023DBB0 /* dbModel.m */, 125 | 42CFDC2B142E836D00ABC9C8 /* CLLocationController.h */, 126 | 42CFDC2C142E836D00ABC9C8 /* CLLocationController.m */, 127 | 42CFDC28142E825300ABC9C8 /* annotationsController.h */, 128 | 42CFDC29142E825300ABC9C8 /* annotationsController.m */, 129 | 424853CF14443DD800622402 /* ConnectedClass.h */, 130 | 424853D014443DD800622402 /* ConnectedClass.m */, 131 | ); 132 | name = "General Classes"; 133 | sourceTree = ""; 134 | }; 135 | 42C589C61402C9D2005D259D = { 136 | isa = PBXGroup; 137 | children = ( 138 | 426A1933143CD50E00CD1A1F /* SystemConfiguration.framework */, 139 | 42FB0AB7142CDE0600E79FD9 /* libsqlite3.0.dylib */, 140 | 42C58A171402C9F0005D259D /* MapKit.framework */, 141 | 42C58A151402C9E9005D259D /* CoreLocation.framework */, 142 | 42C589DB1402C9D2005D259D /* geoJoy */, 143 | 42C58A031402C9D2005D259D /* geoJoyTests */, 144 | 42C589D41402C9D2005D259D /* Frameworks */, 145 | 42C589D21402C9D2005D259D /* Products */, 146 | ); 147 | sourceTree = ""; 148 | }; 149 | 42C589D21402C9D2005D259D /* Products */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 42C589D11402C9D2005D259D /* geoJoy.app */, 153 | ); 154 | name = Products; 155 | sourceTree = ""; 156 | }; 157 | 42C589D41402C9D2005D259D /* Frameworks */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 42C589D51402C9D2005D259D /* UIKit.framework */, 161 | 42C589D71402C9D2005D259D /* Foundation.framework */, 162 | 42C589D91402C9D2005D259D /* CoreGraphics.framework */, 163 | 42C589FC1402C9D2005D259D /* SenTestingKit.framework */, 164 | ); 165 | name = Frameworks; 166 | sourceTree = ""; 167 | }; 168 | 42C589DB1402C9D2005D259D /* geoJoy */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 4206A137142DE9B60023DBB0 /* General Classes */, 172 | 42C589E41402C9D2005D259D /* geoJoyAppDelegate.h */, 173 | 42C589E51402C9D2005D259D /* geoJoyAppDelegate.m */, 174 | 42C589E71402C9D2005D259D /* MainWindow.xib */, 175 | 42C589EA1402C9D2005D259D /* addItemViewController.h */, 176 | 42C589EB1402C9D2005D259D /* addItemViewController.m */, 177 | 42C589F01402C9D2005D259D /* addItemView.xib */, 178 | 42C589ED1402C9D2005D259D /* itemsListViewController.h */, 179 | 42C589EE1402C9D2005D259D /* itemsListViewController.m */, 180 | 42C589F31402C9D2005D259D /* itemsListView.xib */, 181 | 42C58A191402CA42005D259D /* moreInfoViewController.h */, 182 | 42C58A1A1402CA42005D259D /* moreInfoViewController.m */, 183 | 42C58A1B1402CA42005D259D /* moreInfoView.xib */, 184 | 42C589DC1402C9D2005D259D /* Supporting Files */, 185 | ); 186 | path = geoJoy; 187 | sourceTree = ""; 188 | }; 189 | 42C589DC1402C9D2005D259D /* Supporting Files */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 42AA471E1435E5CC006D090D /* Default@2x.png */, 193 | 42AA471B1435E5C7006D090D /* Default.png */, 194 | 42668AB81434CDBE0084C261 /* Icon.png */, 195 | 42668AB61434CDAC0084C261 /* icon@2x.png */, 196 | 421D9ABE1435DF5000ABA55D /* logoClaim.png */, 197 | 4270BB51142F4C9000A39CC0 /* geojoy.sqlite */, 198 | 4270BB4D142F41EB00A39CC0 /* position.png */, 199 | 4270BB4E142F41EB00A39CC0 /* position@2x.png */, 200 | 42B350FB142CA0390099924E /* app_title.png */, 201 | 42B350FC142CA0390099924E /* app_title@2x.png */, 202 | 426E268B14052BFC00C47A26 /* bookmark.png */, 203 | 426E268C14052BFC00C47A26 /* bookmark@2x.png */, 204 | 42C589DD1402C9D2005D259D /* geoJoy-Info.plist */, 205 | 42C589DE1402C9D2005D259D /* InfoPlist.strings */, 206 | 42C589E11402C9D2005D259D /* main.m */, 207 | 42C589E31402C9D2005D259D /* geoJoy-Prefix.pch */, 208 | ); 209 | name = "Supporting Files"; 210 | sourceTree = ""; 211 | }; 212 | 42C58A031402C9D2005D259D /* geoJoyTests */ = { 213 | isa = PBXGroup; 214 | children = ( 215 | 42C58A091402C9D2005D259D /* geoJoyTests.h */, 216 | 42C58A0B1402C9D2005D259D /* geoJoyTests.m */, 217 | 42C58A041402C9D2005D259D /* Supporting Files */, 218 | ); 219 | path = geoJoyTests; 220 | sourceTree = ""; 221 | }; 222 | 42C58A041402C9D2005D259D /* Supporting Files */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | 42C58A051402C9D2005D259D /* geoJoyTests-Info.plist */, 226 | 42C58A061402C9D2005D259D /* InfoPlist.strings */, 227 | ); 228 | name = "Supporting Files"; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXGroup section */ 232 | 233 | /* Begin PBXNativeTarget section */ 234 | 42C589D01402C9D2005D259D /* geoJoy */ = { 235 | isa = PBXNativeTarget; 236 | buildConfigurationList = 42C58A0F1402C9D2005D259D /* Build configuration list for PBXNativeTarget "geoJoy" */; 237 | buildPhases = ( 238 | 42C589CD1402C9D2005D259D /* Sources */, 239 | 42C589CE1402C9D2005D259D /* Frameworks */, 240 | 42C589CF1402C9D2005D259D /* Resources */, 241 | ); 242 | buildRules = ( 243 | ); 244 | dependencies = ( 245 | ); 246 | name = geoJoy; 247 | productName = geoJoy; 248 | productReference = 42C589D11402C9D2005D259D /* geoJoy.app */; 249 | productType = "com.apple.product-type.application"; 250 | }; 251 | /* End PBXNativeTarget section */ 252 | 253 | /* Begin PBXProject section */ 254 | 42C589C81402C9D2005D259D /* Project object */ = { 255 | isa = PBXProject; 256 | attributes = { 257 | LastUpgradeCheck = 0420; 258 | }; 259 | buildConfigurationList = 42C589CB1402C9D2005D259D /* Build configuration list for PBXProject "geoJoy" */; 260 | compatibilityVersion = "Xcode 3.2"; 261 | developmentRegion = English; 262 | hasScannedForEncodings = 0; 263 | knownRegions = ( 264 | en, 265 | ); 266 | mainGroup = 42C589C61402C9D2005D259D; 267 | productRefGroup = 42C589D21402C9D2005D259D /* Products */; 268 | projectDirPath = ""; 269 | projectRoot = ""; 270 | targets = ( 271 | 42C589D01402C9D2005D259D /* geoJoy */, 272 | ); 273 | }; 274 | /* End PBXProject section */ 275 | 276 | /* Begin PBXResourcesBuildPhase section */ 277 | 42C589CF1402C9D2005D259D /* Resources */ = { 278 | isa = PBXResourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 42C589E01402C9D2005D259D /* InfoPlist.strings in Resources */, 282 | 42C589E91402C9D2005D259D /* MainWindow.xib in Resources */, 283 | 42C589F21402C9D2005D259D /* addItemView.xib in Resources */, 284 | 42C589F51402C9D2005D259D /* itemsListView.xib in Resources */, 285 | 42C58A1D1402CA42005D259D /* moreInfoView.xib in Resources */, 286 | 426E268D14052BFC00C47A26 /* bookmark.png in Resources */, 287 | 426E268E14052BFC00C47A26 /* bookmark@2x.png in Resources */, 288 | 42B350FD142CA0390099924E /* app_title.png in Resources */, 289 | 42B350FE142CA0390099924E /* app_title@2x.png in Resources */, 290 | 4270BB4F142F41EB00A39CC0 /* position.png in Resources */, 291 | 4270BB50142F41EB00A39CC0 /* position@2x.png in Resources */, 292 | 4270BB52142F4C9000A39CC0 /* geojoy.sqlite in Resources */, 293 | 42668AB71434CDAC0084C261 /* icon@2x.png in Resources */, 294 | 42668AB91434CDBE0084C261 /* Icon.png in Resources */, 295 | 421D9ABF1435DF5000ABA55D /* logoClaim.png in Resources */, 296 | 42AA471C1435E5C7006D090D /* Default.png in Resources */, 297 | 42AA471F1435E5CC006D090D /* Default@2x.png in Resources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXResourcesBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | 42C589CD1402C9D2005D259D /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 42C589E21402C9D2005D259D /* main.m in Sources */, 309 | 42C589E61402C9D2005D259D /* geoJoyAppDelegate.m in Sources */, 310 | 42C589EC1402C9D2005D259D /* addItemViewController.m in Sources */, 311 | 42C589EF1402C9D2005D259D /* itemsListViewController.m in Sources */, 312 | 42C58A1C1402CA42005D259D /* moreInfoViewController.m in Sources */, 313 | 4206A136142DE9AE0023DBB0 /* dbModel.m in Sources */, 314 | 42CFDC2A142E825300ABC9C8 /* annotationsController.m in Sources */, 315 | 42CFDC2D142E836D00ABC9C8 /* CLLocationController.m in Sources */, 316 | 424853CE14443C5500622402 /* Reachability.m in Sources */, 317 | 424853D114443DD800622402 /* ConnectedClass.m in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXSourcesBuildPhase section */ 322 | 323 | /* Begin PBXVariantGroup section */ 324 | 42C589DE1402C9D2005D259D /* InfoPlist.strings */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 42C589DF1402C9D2005D259D /* en */, 328 | ); 329 | name = InfoPlist.strings; 330 | sourceTree = ""; 331 | }; 332 | 42C589E71402C9D2005D259D /* MainWindow.xib */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 42C589E81402C9D2005D259D /* en */, 336 | ); 337 | name = MainWindow.xib; 338 | sourceTree = ""; 339 | }; 340 | 42C589F01402C9D2005D259D /* addItemView.xib */ = { 341 | isa = PBXVariantGroup; 342 | children = ( 343 | 42C589F11402C9D2005D259D /* en */, 344 | ); 345 | name = addItemView.xib; 346 | sourceTree = ""; 347 | }; 348 | 42C589F31402C9D2005D259D /* itemsListView.xib */ = { 349 | isa = PBXVariantGroup; 350 | children = ( 351 | 42C589F41402C9D2005D259D /* en */, 352 | ); 353 | name = itemsListView.xib; 354 | sourceTree = ""; 355 | }; 356 | 42C58A061402C9D2005D259D /* InfoPlist.strings */ = { 357 | isa = PBXVariantGroup; 358 | children = ( 359 | 42C58A071402C9D2005D259D /* en */, 360 | ); 361 | name = InfoPlist.strings; 362 | sourceTree = ""; 363 | }; 364 | /* End PBXVariantGroup section */ 365 | 366 | /* Begin XCBuildConfiguration section */ 367 | 42C58A0D1402C9D2005D259D /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 372 | CODE_SIGN_IDENTITY = "iPhone Developer"; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = NO; 375 | GCC_C_LANGUAGE_STANDARD = gnu99; 376 | GCC_DYNAMIC_NO_PIC = NO; 377 | GCC_OPTIMIZATION_LEVEL = 0; 378 | GCC_PREPROCESSOR_DEFINITIONS = ( 379 | "DEBUG=1", 380 | "$(inherited)", 381 | ); 382 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 383 | GCC_VERSION = com.apple.compilers.llvmgcc42; 384 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 386 | GCC_WARN_UNUSED_VARIABLE = YES; 387 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 388 | PROVISIONING_PROFILE = ""; 389 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; 390 | SDKROOT = iphoneos; 391 | SKIP_INSTALL = NO; 392 | }; 393 | name = Debug; 394 | }; 395 | 42C58A0E1402C9D2005D259D /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ALWAYS_SEARCH_USER_PATHS = NO; 399 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 400 | CODE_SIGN_IDENTITY = "iPhone Distribution: Jakob Renpening"; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Jakob Renpening"; 402 | COPY_PHASE_STRIP = YES; 403 | GCC_C_LANGUAGE_STANDARD = gnu99; 404 | GCC_VERSION = com.apple.compilers.llvmgcc42; 405 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 407 | GCC_WARN_UNUSED_VARIABLE = YES; 408 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 409 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 410 | PROVISIONING_PROFILE = "0200DB2A-92DB-4E22-A980-F50691DE2EA8"; 411 | "PROVISIONING_PROFILE[sdk=iphoneos*]" = "0200DB2A-92DB-4E22-A980-F50691DE2EA8"; 412 | SDKROOT = iphoneos; 413 | SKIP_INSTALL = YES; 414 | VALIDATE_PRODUCT = YES; 415 | }; 416 | name = Release; 417 | }; 418 | 42C58A101402C9D2005D259D /* Debug */ = { 419 | isa = XCBuildConfiguration; 420 | buildSettings = { 421 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 422 | GCC_PREFIX_HEADER = "geoJoy/geoJoy-Prefix.pch"; 423 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 424 | INFOPLIST_FILE = "geoJoy/geoJoy-Info.plist"; 425 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SKIP_INSTALL = NO; 428 | TARGETED_DEVICE_FAMILY = 1; 429 | WRAPPER_EXTENSION = app; 430 | }; 431 | name = Debug; 432 | }; 433 | 42C58A111402C9D2005D259D /* Release */ = { 434 | isa = XCBuildConfiguration; 435 | buildSettings = { 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "geoJoy/geoJoy-Prefix.pch"; 438 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 439 | INFOPLIST_FILE = "geoJoy/geoJoy-Info.plist"; 440 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | SKIP_INSTALL = NO; 443 | TARGETED_DEVICE_FAMILY = 1; 444 | WRAPPER_EXTENSION = app; 445 | }; 446 | name = Release; 447 | }; 448 | /* End XCBuildConfiguration section */ 449 | 450 | /* Begin XCConfigurationList section */ 451 | 42C589CB1402C9D2005D259D /* Build configuration list for PBXProject "geoJoy" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | 42C58A0D1402C9D2005D259D /* Debug */, 455 | 42C58A0E1402C9D2005D259D /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | 42C58A0F1402C9D2005D259D /* Build configuration list for PBXNativeTarget "geoJoy" */ = { 461 | isa = XCConfigurationList; 462 | buildConfigurations = ( 463 | 42C58A101402C9D2005D259D /* Debug */, 464 | 42C58A111402C9D2005D259D /* Release */, 465 | ); 466 | defaultConfigurationIsVisible = 0; 467 | defaultConfigurationName = Release; 468 | }; 469 | /* End XCConfigurationList section */ 470 | }; 471 | rootObject = 42C589C81402C9D2005D259D /* Project object */; 472 | } 473 | --------------------------------------------------------------------------------