Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructuring project directories like Xcode 4 does
- Loading branch information
Showing
34 changed files
with
990 additions
and
665 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* Localized versions of Info.plist keys */ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
File renamed without changes.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* Localized versions of Info.plist keys */ | ||
|
Oops, something went wrong.