Permalink
Browse files

Restructuring project directories like Xcode 4 does

  • Loading branch information...
1 parent 2365cc2 commit de3dee9635eb1a27556a8c88d19a8fa6dc3af4f5 @rvenable committed Feb 10, 2011
Showing with 990 additions and 665 deletions.
  1. +489 −232 BfoxRef.xcodeproj/project.pbxproj
  2. 0 BfoxRef/{ → en.lproj}/BfoxBookNamesDefault.strings
  3. 0 BfoxRef/{ → en.lproj}/BfoxBookNamesShort.strings
  4. 0 BfoxRef/{ → en.lproj}/BfoxBookRegexes.strings
  5. 0 BfoxRef/{ → en.lproj}/BfoxBookSynonymLookup.strings
  6. +22 −0 BfoxRefTests/BfoxRefTests-Info.plist
  7. +7 −0 BfoxRefTests/BfoxRefTests-Prefix.pch
  8. +17 −0 BfoxRefTests/BfoxRefTests.h
  9. +33 −0 BfoxRefTests/BfoxRefTests.m
  10. +2 −0 BfoxRefTests/en.lproj/InfoPlist.strings
  11. +0 −8 BfoxRef_Prefix.pch
  12. +6 −2 { → Project}/BfoxRef-Info.plist
  13. +15 −0 Project/BfoxRef-Prefix.pch
  14. 0 {Shared → Project}/BfoxRef.xcdatamodeld/.xccurrentversion
  15. BIN Project/BfoxRef.xcdatamodeld/BfoxRef.xcdatamodel/elements
  16. BIN Project/BfoxRef.xcdatamodeld/BfoxRef.xcdatamodel/layout
  17. +5 −13 Shared/AppDelegate_Shared.h → Project/BfoxRefAppDelegate.h
  18. +211 −0 Project/BfoxRefAppDelegate.m
  19. +2 −0 Project/en.lproj/InfoPlist.strings
  20. +16 −0 Project/iPad/BfoxRefAppDelegate_iPad.h
  21. +18 −0 Project/iPad/BfoxRefAppDelegate_iPad.m
  22. +49 −12 {iPad → Project/iPad/en.lproj}/MainWindow_iPad.xib
  23. +16 −0 Project/iPhone/BfoxRefAppDelegate_iPhone.h
  24. +18 −0 Project/iPhone/BfoxRefAppDelegate_iPhone.m
  25. +47 −10 {iPhone → Project/iPhone/en.lproj}/MainWindow_iPhone.xib
  26. +17 −0 Project/main.m
  27. +0 −168 Shared/AppDelegate_Shared.m
  28. BIN Shared/BfoxRef.xcdatamodeld/BfoxRef.xcdatamodel/elements
  29. BIN Shared/BfoxRef.xcdatamodeld/BfoxRef.xcdatamodel/layout
  30. +0 −17 Shared/main.m
  31. +0 −17 iPad/AppDelegate_iPad.h
  32. +0 −68 iPad/AppDelegate_iPad.m
  33. +0 −18 iPhone/AppDelegate_iPhone.h
  34. +0 −100 iPhone/AppDelegate_iPhone.m
View
721 BfoxRef.xcodeproj/project.pbxproj 100755 → 100644

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.epicfox.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'BfoxRefTests' target in the 'BfoxRefTests' project
+//
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+#endif
@@ -0,0 +1,17 @@
+//
+// BfoxRefTests.h
+// BfoxRefTests
+//
+// Created by Richard Venable on 2/9/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface BfoxRefTests : SenTestCase {
+@private
+
+}
+
+@end
@@ -0,0 +1,33 @@
+//
+// BfoxRefTests.m
+// BfoxRefTests
+//
+// Created by Richard Venable on 2/9/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "BfoxRefTests.h"
+
+
+@implementation BfoxRefTests
+
+- (void)setUp
+{
+ [super setUp];
+
+ // Set-up code here.
+}
+
+- (void)tearDown
+{
+ // Tear-down code here.
+
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ STFail(@"Unit tests are not implemented yet in BfoxRefTests");
+}
+
+@end
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
@@ -1,8 +0,0 @@
-//
-// Prefix header for all source files of the 'BfoxRef' target in the 'BfoxRef' project
-//
-
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
-#endif
@@ -3,21 +3,23 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
- <string>English</string>
+ <string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.epicfox.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -31,6 +33,8 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
View
@@ -0,0 +1,15 @@
+//
+// Prefix header for all source files of the 'BfoxRef' target in the 'BfoxRef' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_3_0
+#warning "This project uses features only available in iPhone SDK 3.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+ #import <CoreData/CoreData.h>
+#endif
Binary file not shown.
Binary file not shown.
@@ -1,22 +1,15 @@
//
-// AppDelegate_Shared.h
+// BfoxRefAppDelegate.h
// BfoxRef
//
-// Created by Richard Venable on 1/30/11.
+// Created by Richard Venable on 2/9/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
-#import <CoreData/CoreData.h>
-@interface AppDelegate_Shared : NSObject <UIApplicationDelegate> {
-
- UIWindow *window;
-
-@private
- NSManagedObjectContext *managedObjectContext_;
- NSManagedObjectModel *managedObjectModel_;
- NSPersistentStoreCoordinator *persistentStoreCoordinator_;
+@interface BfoxRefAppDelegate : NSObject <UIApplicationDelegate> {
+
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@@ -25,8 +18,7 @@
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
-- (NSURL *)applicationDocumentsDirectory;
- (void)saveContext;
+- (NSURL *)applicationDocumentsDirectory;
@end
-
@@ -0,0 +1,211 @@
+//
+// BfoxRefAppDelegate.m
+// BfoxRef
+//
+// Created by Richard Venable on 2/9/11.
+// Copyright 2011 __MyCompanyName__. All rights reserved.
+//
+
+#import "BfoxRefAppDelegate.h"
+#import "BfoxRef.h"
+
+@implementation BfoxRefAppDelegate
+
+
+@synthesize window=_window;
+
+@synthesize managedObjectContext=__managedObjectContext;
+
+@synthesize managedObjectModel=__managedObjectModel;
+
+@synthesize persistentStoreCoordinator=__persistentStoreCoordinator;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ // Override point for customization after application launch.
+ NSString *refString = @"Genesis 1";
+ BfoxRef *ref = [BfoxRef refWithString:refString];
+ NSLog(@"Ref check: '%@' => '%@'", refString, ref);
+
+ // Create a ref with the entire bible
+ ref = [BfoxRef ref];
+ [ref addEntireBible];
+ NSLog(@"%@", [ref shortString]);
+
+ // Create an array of refs of each book in the bible
+ NSArray *books = [ref arrayOfRefsByBooks];
+ for (BfoxRef *book in books) {
+ NSLog(@"%@", book);
+ }
+
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ 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.
+ 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.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ 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.
+ If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ /*
+ 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.
+ */
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ /*
+ 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.
+ */
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Saves changes in the application's managed object context before the application terminates.
+ [self saveContext];
+}
+
+- (void)dealloc
+{
+ [_window release];
+ [__managedObjectContext release];
+ [__managedObjectModel release];
+ [__persistentStoreCoordinator release];
+ [super dealloc];
+}
+
+- (void)awakeFromNib
+{
+ /*
+ Typically you should set up the Core Data stack here, usually by passing the managed object context to the first view controller.
+ self.<#View controller#>.managedObjectContext = self.managedObjectContext;
+ */
+}
+
+- (void)saveContext
+{
+ NSError *error = nil;
+ NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
+ if (managedObjectContext != nil)
+ {
+ if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error])
+ {
+ /*
+ Replace this implementation with code to handle the error appropriately.
+
+ abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
+ */
+ NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
+ abort();
+ }
+ }
+}
+
+#pragma mark - Core Data stack
+
+/**
+ Returns the managed object context for the application.
+ If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
+ */
+- (NSManagedObjectContext *)managedObjectContext
+{
+ if (__managedObjectContext != nil)
+ {
+ return __managedObjectContext;
+ }
+
+ NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
+ if (coordinator != nil)
+ {
+ __managedObjectContext = [[NSManagedObjectContext alloc] init];
+ [__managedObjectContext setPersistentStoreCoordinator:coordinator];
+ }
+ return __managedObjectContext;
+}
+
+/**
+ Returns the managed object model for the application.
+ If the model doesn't already exist, it is created from the application's model.
+ */
+- (NSManagedObjectModel *)managedObjectModel
+{
+ if (__managedObjectModel != nil)
+ {
+ return __managedObjectModel;
+ }
+ NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"BfoxRef" withExtension:@"momd"];
+ __managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
+ return __managedObjectModel;
+}
+
+/**
+ Returns the persistent store coordinator for the application.
+ If the coordinator doesn't already exist, it is created and the application's store added to it.
+ */
+- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
+{
+ if (__persistentStoreCoordinator != nil)
+ {
+ return __persistentStoreCoordinator;
+ }
+
+ NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"BfoxRef.sqlite"];
+
+ NSError *error = nil;
+ __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
+ if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error])
+ {
+ /*
+ Replace this implementation with code to handle the error appropriately.
+
+ abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
+
+ Typical reasons for an error here include:
+ * The persistent store is not accessible;
+ * The schema for the persistent store is incompatible with current managed object model.
+ Check the error message to determine what the actual problem was.
+
+
+ If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory.
+
+ If you encounter schema incompatibility errors during development, you can reduce their frequency by:
+ * Simply deleting the existing store:
+ [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]
+
+ * Performing automatic lightweight migration by passing the following dictionary as the options parameter:
+ [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
+
+ Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details.
+
+ */
+ NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
+ abort();
+ }
+
+ return __persistentStoreCoordinator;
+}
+
+#pragma mark - Application's Documents directory
+
+/**
+ Returns the URL to the application's Documents directory.
+ */
+- (NSURL *)applicationDocumentsDirectory
+{
+ return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
+}
+
+@end
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
Oops, something went wrong.

0 comments on commit de3dee9

Please sign in to comment.