diff --git a/PersistentModelTest/.gitignore b/PersistentModel/.gitignore
similarity index 100%
rename from PersistentModelTest/.gitignore
rename to PersistentModel/.gitignore
diff --git a/PersistentModel/PersistentModel Tests/Info.plist b/PersistentModel/PersistentModel Tests/Info.plist
new file mode 100644
index 0000000..fb2c8d0
--- /dev/null
+++ b/PersistentModel/PersistentModel Tests/Info.plist
@@ -0,0 +1,24 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ com.mobilejazz.$(PRODUCT_NAME:rfc1034identifier)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+
+
diff --git a/PersistentModel/PersistentModel Tests/PersistentModel_Tests.m b/PersistentModel/PersistentModel Tests/PersistentModel_Tests.m
new file mode 100644
index 0000000..9c01134
--- /dev/null
+++ b/PersistentModel/PersistentModel Tests/PersistentModel_Tests.m
@@ -0,0 +1,83 @@
+//
+// PersistentModel_Tests.m
+// PersistentModel Tests
+//
+// Created by Joan Martin on 16/12/14.
+// Copyright (c) 2014 Joan Martin. All rights reserved.
+//
+
+#import
+#import
+
+#import "PersistentModel.h"
+
+NSURL* applicationCacheDirectory()
+{
+ static NSURL *url = nil;
+
+ static dispatch_once_t onceToken;
+
+ dispatch_once(&onceToken, ^{
+ NSArray *pathList = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+ NSString *cachePath = [pathList[0] stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]];
+
+ // Create cache path if it doesn't exist, yet:
+ BOOL isDir = NO;
+ NSError *error;
+ if (! [[NSFileManager defaultManager] fileExistsAtPath:cachePath isDirectory:&isDir] && isDir == NO)
+ [[NSFileManager defaultManager] createDirectoryAtPath:cachePath withIntermediateDirectories:YES attributes:nil error:&error];
+
+ url = [NSURL fileURLWithPath:cachePath];
+ });
+
+ return url;
+}
+
+@interface PersistentModel_Tests : XCTestCase
+
+@end
+
+@implementation PersistentModel_Tests
+{
+ PMPersistentStore *_persistentStore;
+ PMObjectContext *_objectContext;
+}
+
+- (void)setUp
+{
+ [super setUp];
+
+ // Creating the URL where we will store the database
+ NSURL *url = [applicationCacheDirectory() URLByAppendingPathComponent:@"test.sql"];
+
+ // Instantiating the persistent store
+ _persistentStore = [[PMSQLiteStore alloc] initWithURL:url];
+
+ // Creating an object context connected to the persistent store
+ _objectContext = [[PMObjectContext alloc] initWithPersistentStore:_persistentStore];
+}
+
+- (void)tearDown
+{
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void)testExample
+{
+ // This is an example of a functional test case.
+ XCTAssert(YES, @"Pass");
+}
+
+- (void)testPerformanceExample
+{
+ // This is an example of a performance test case.
+ [self measureBlock:^{
+ // Put the code you want to measure the time of here.
+ }];
+}
+
+#pragma mark - Index
+
+
+@end
diff --git a/PersistentModelTest/PersistentModelTest.xcodeproj/project.pbxproj b/PersistentModel/PersistentModel.xcodeproj/project.pbxproj
similarity index 61%
rename from PersistentModelTest/PersistentModelTest.xcodeproj/project.pbxproj
rename to PersistentModel/PersistentModel.xcodeproj/project.pbxproj
index 141870d..25ab1a6 100644
--- a/PersistentModelTest/PersistentModelTest.xcodeproj/project.pbxproj
+++ b/PersistentModel/PersistentModel.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
+ 8F5D9E2EF62AA17C7B9E4AD1 /* libPods-PersistentModel Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC8E80E8E64CB772D491AEF /* libPods-PersistentModel Tests.a */; };
+ 90C28346687EEA3AF9300FED /* libPods-PersistentModel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 95B28F9C3D8D9DA424FEABCE /* libPods-PersistentModel.a */; };
D201AA1B18DC75E600E5F26D /* PMBaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA0D18DC75E600E5F26D /* PMBaseObject.m */; };
D201AA1D18DC75E600E5F26D /* PMObjectContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1118DC75E600E5F26D /* PMObjectContext.m */; };
D201AA1E18DC75E600E5F26D /* PMPersistentStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1418DC75E600E5F26D /* PMPersistentStore.m */; };
@@ -14,8 +16,21 @@
D201AA2018DC75E600E5F26D /* PMSQLiteStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1918DC75E600E5F26D /* PMSQLiteStore.m */; };
D201AA2318DC7C6600E5F26D /* PMVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA2218DC7C6600E5F26D /* PMVideo.m */; };
D201AA2618DC7C6E00E5F26D /* PMUser.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA2518DC7C6E00E5F26D /* PMUser.m */; };
- D226129F1A35B8AF00EFBF83 /* NSArray+PMBaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D226129E1A35B8AF00EFBF83 /* NSArray+PMBaseObject.m */; };
D251290B19E6DE4F000904BD /* PMObjectIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = D251290A19E6DE4F000904BD /* PMObjectIndex.m */; };
+ D257646E1A4075EA00C59CD1 /* PersistentModel_Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = D257646D1A4075EA00C59CD1 /* PersistentModel_Tests.m */; };
+ D25764741A40776D00C59CD1 /* PMBaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA0D18DC75E600E5F26D /* PMBaseObject.m */; };
+ D25764751A40776D00C59CD1 /* PMObjectContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1118DC75E600E5F26D /* PMObjectContext.m */; };
+ D25764761A40776D00C59CD1 /* PMObjectID.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C986BC19DAB8F300043329 /* PMObjectID.m */; };
+ D25764771A40776D00C59CD1 /* PMFetchRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D29B88DB19E2F0AF00361F24 /* PMFetchRequest.m */; };
+ D25764781A40776D00C59CD1 /* PMKeyedArchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = D29B88D519E2EBCA00361F24 /* PMKeyedArchiver.m */; };
+ D25764791A40776D00C59CD1 /* PMKeyedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = D29B88D819E2EC5A00361F24 /* PMKeyedUnarchiver.m */; };
+ D257647A1A40776D00C59CD1 /* PMObjectIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = D251290A19E6DE4F000904BD /* PMObjectIndex.m */; };
+ D257647B1A40776D00C59CD1 /* PMPersistentObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C986C019DAF56300043329 /* PMPersistentObject.m */; };
+ D257647C1A40776D00C59CD1 /* PMPersistentStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1418DC75E600E5F26D /* PMPersistentStore.m */; };
+ D257647D1A40776D00C59CD1 /* PMSQLiteObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1618DC75E600E5F26D /* PMSQLiteObject.m */; };
+ D257647E1A40776D00C59CD1 /* PMSQLiteStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D201AA1918DC75E600E5F26D /* PMSQLiteStore.m */; };
+ D25764831A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = D25764811A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig */; };
+ D25764841A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = D25764821A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig */; };
D26C2B3518BFB1CF00E8BE90 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D26C2B3418BFB1CF00E8BE90 /* Foundation.framework */; };
D26C2B3718BFB1CF00E8BE90 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D26C2B3618BFB1CF00E8BE90 /* CoreGraphics.framework */; };
D26C2B3918BFB1CF00E8BE90 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D26C2B3818BFB1CF00E8BE90 /* UIKit.framework */; };
@@ -28,12 +43,24 @@
D29B88DC19E2F0AF00361F24 /* PMFetchRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D29B88DB19E2F0AF00361F24 /* PMFetchRequest.m */; };
D2C986BD19DAB8F300043329 /* PMObjectID.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C986BC19DAB8F300043329 /* PMObjectID.m */; };
D2C986C119DAF56300043329 /* PMPersistentObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C986C019DAF56300043329 /* PMPersistentObject.m */; };
- D754E87AA4B84C06BBF43DCD /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9281106B868B42E48ADF6C46 /* libPods.a */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ D257646F1A4075EA00C59CD1 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = D26C2B2918BFB1CF00E8BE90 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = D26C2B3018BFB1CF00E8BE90;
+ remoteInfo = PersistentModel;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
- 269C608F53274FD0AC433315 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; };
+ 0A919120130127B0DECF0C6E /* Pods-PersistentModel Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PersistentModel Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PersistentModel Tests/Pods-PersistentModel Tests.release.xcconfig"; sourceTree = ""; };
+ 6D26BF271C6D22AC83FE7ED4 /* Pods-PersistentModel Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PersistentModel Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PersistentModel Tests/Pods-PersistentModel Tests.debug.xcconfig"; sourceTree = ""; };
+ 8DC8E80E8E64CB772D491AEF /* libPods-PersistentModel Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PersistentModel Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9281106B868B42E48ADF6C46 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 95B28F9C3D8D9DA424FEABCE /* libPods-PersistentModel.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PersistentModel.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D201AA0B18DC75E600E5F26D /* PersistentModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PersistentModel.h; sourceTree = ""; };
D201AA0C18DC75E600E5F26D /* PMBaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMBaseObject.h; sourceTree = ""; };
D201AA0D18DC75E600E5F26D /* PMBaseObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMBaseObject.m; sourceTree = ""; };
@@ -52,19 +79,23 @@
D201AA2218DC7C6600E5F26D /* PMVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMVideo.m; sourceTree = ""; };
D201AA2418DC7C6E00E5F26D /* PMUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMUser.h; sourceTree = ""; };
D201AA2518DC7C6E00E5F26D /* PMUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMUser.m; sourceTree = ""; };
- D226129D1A35B8AF00EFBF83 /* NSArray+PMBaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+PMBaseObject.h"; sourceTree = ""; };
- D226129E1A35B8AF00EFBF83 /* NSArray+PMBaseObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+PMBaseObject.m"; sourceTree = ""; };
D251290919E6DE4F000904BD /* PMObjectIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMObjectIndex.h; sourceTree = ""; };
D251290A19E6DE4F000904BD /* PMObjectIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMObjectIndex.m; sourceTree = ""; };
D251290C19E6F1A2000904BD /* PMObjectContext_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMObjectContext_Private.h; sourceTree = ""; };
- D26C2B3118BFB1CF00E8BE90 /* PersistentModelTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PersistentModelTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ D25764691A4075EA00C59CD1 /* PersistentModel Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PersistentModel Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ D257646C1A4075EA00C59CD1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ D257646D1A4075EA00C59CD1 /* PersistentModel_Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PersistentModel_Tests.m; sourceTree = ""; };
+ D257647F1A4077A700C59CD1 /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPods.a; path = "Pods/build/Debug-iphoneos/libPods.a"; sourceTree = ""; };
+ D25764811A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-PersistentModel.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PersistentModel/Pods-PersistentModel.debug.xcconfig"; sourceTree = ""; };
+ D25764821A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-PersistentModel.release.xcconfig"; path = "Pods/Target Support Files/Pods-PersistentModel/Pods-PersistentModel.release.xcconfig"; sourceTree = ""; };
+ D26C2B3118BFB1CF00E8BE90 /* PersistentModel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PersistentModel.app; sourceTree = BUILT_PRODUCTS_DIR; };
D26C2B3418BFB1CF00E8BE90 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D26C2B3618BFB1CF00E8BE90 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
D26C2B3818BFB1CF00E8BE90 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
- D26C2B3C18BFB1CF00E8BE90 /* PersistentModelTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PersistentModelTest-Info.plist"; sourceTree = ""; };
+ D26C2B3C18BFB1CF00E8BE90 /* PersistentModel-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PersistentModel-Info.plist"; sourceTree = ""; };
D26C2B3E18BFB1CF00E8BE90 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
D26C2B4018BFB1CF00E8BE90 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
- D26C2B4218BFB1CF00E8BE90 /* PersistentModelTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PersistentModelTest-Prefix.pch"; sourceTree = ""; };
+ D26C2B4218BFB1CF00E8BE90 /* PersistentModel-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PersistentModel-Prefix.pch"; sourceTree = ""; };
D26C2B4318BFB1CF00E8BE90 /* PMAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PMAppDelegate.h; sourceTree = ""; };
D26C2B4418BFB1CF00E8BE90 /* PMAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PMAppDelegate.m; sourceTree = ""; };
D26C2B4618BFB1CF00E8BE90 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
@@ -83,6 +114,14 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ D25764661A4075EA00C59CD1 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8F5D9E2EF62AA17C7B9E4AD1 /* libPods-PersistentModel Tests.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
D26C2B2E18BFB1CF00E8BE90 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -90,7 +129,7 @@
D26C2B3718BFB1CF00E8BE90 /* CoreGraphics.framework in Frameworks */,
D26C2B3918BFB1CF00E8BE90 /* UIKit.framework in Frameworks */,
D26C2B3518BFB1CF00E8BE90 /* Foundation.framework in Frameworks */,
- D754E87AA4B84C06BBF43DCD /* libPods.a in Frameworks */,
+ 90C28346687EEA3AF9300FED /* libPods-PersistentModel.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -104,8 +143,6 @@
D201AA0C18DC75E600E5F26D /* PMBaseObject.h */,
D2C986BF19DACBA600043329 /* PMBaseObject_Private.h */,
D201AA0D18DC75E600E5F26D /* PMBaseObject.m */,
- D226129D1A35B8AF00EFBF83 /* NSArray+PMBaseObject.h */,
- D226129E1A35B8AF00EFBF83 /* NSArray+PMBaseObject.m */,
D201AA1018DC75E600E5F26D /* PMObjectContext.h */,
D201AA1118DC75E600E5F26D /* PMObjectContext.m */,
D251290C19E6F1A2000904BD /* PMObjectContext_Private.h */,
@@ -121,20 +158,39 @@
path = ../../Source;
sourceTree = "";
};
+ D257646A1A4075EA00C59CD1 /* PersistentModel Tests */ = {
+ isa = PBXGroup;
+ children = (
+ D257646D1A4075EA00C59CD1 /* PersistentModel_Tests.m */,
+ D257646B1A4075EA00C59CD1 /* Supporting Files */,
+ );
+ path = "PersistentModel Tests";
+ sourceTree = "";
+ };
+ D257646B1A4075EA00C59CD1 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ D257646C1A4075EA00C59CD1 /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
D26C2B2818BFB1CF00E8BE90 = {
isa = PBXGroup;
children = (
- D26C2B3A18BFB1CF00E8BE90 /* PersistentModelTest */,
+ D26C2B3A18BFB1CF00E8BE90 /* PersistentModel */,
+ D257646A1A4075EA00C59CD1 /* PersistentModel Tests */,
D26C2B3318BFB1CF00E8BE90 /* Frameworks */,
D26C2B3218BFB1CF00E8BE90 /* Products */,
- 269C608F53274FD0AC433315 /* Pods.xcconfig */,
+ E1B6E180E8EDFB2628E63A69 /* Pods */,
);
sourceTree = "";
};
D26C2B3218BFB1CF00E8BE90 /* Products */ = {
isa = PBXGroup;
children = (
- D26C2B3118BFB1CF00E8BE90 /* PersistentModelTest.app */,
+ D26C2B3118BFB1CF00E8BE90 /* PersistentModel.app */,
+ D25764691A4075EA00C59CD1 /* PersistentModel Tests.xctest */,
);
name = Products;
sourceTree = "";
@@ -142,16 +198,19 @@
D26C2B3318BFB1CF00E8BE90 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ D257647F1A4077A700C59CD1 /* libPods.a */,
D26C2B3418BFB1CF00E8BE90 /* Foundation.framework */,
D26C2B3618BFB1CF00E8BE90 /* CoreGraphics.framework */,
D26C2B3818BFB1CF00E8BE90 /* UIKit.framework */,
D26C2B4D18BFB1CF00E8BE90 /* XCTest.framework */,
9281106B868B42E48ADF6C46 /* libPods.a */,
+ 95B28F9C3D8D9DA424FEABCE /* libPods-PersistentModel.a */,
+ 8DC8E80E8E64CB772D491AEF /* libPods-PersistentModel Tests.a */,
);
name = Frameworks;
sourceTree = "";
};
- D26C2B3A18BFB1CF00E8BE90 /* PersistentModelTest */ = {
+ D26C2B3A18BFB1CF00E8BE90 /* PersistentModel */ = {
isa = PBXGroup;
children = (
D26C2B4318BFB1CF00E8BE90 /* PMAppDelegate.h */,
@@ -164,16 +223,16 @@
D26C2B4618BFB1CF00E8BE90 /* Images.xcassets */,
D26C2B3B18BFB1CF00E8BE90 /* Supporting Files */,
);
- path = PersistentModelTest;
+ path = PersistentModel;
sourceTree = "";
};
D26C2B3B18BFB1CF00E8BE90 /* Supporting Files */ = {
isa = PBXGroup;
children = (
- D26C2B3C18BFB1CF00E8BE90 /* PersistentModelTest-Info.plist */,
+ D26C2B3C18BFB1CF00E8BE90 /* PersistentModel-Info.plist */,
D26C2B3D18BFB1CF00E8BE90 /* InfoPlist.strings */,
D26C2B4018BFB1CF00E8BE90 /* main.m */,
- D26C2B4218BFB1CF00E8BE90 /* PersistentModelTest-Prefix.pch */,
+ D26C2B4218BFB1CF00E8BE90 /* PersistentModel-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "";
@@ -208,12 +267,43 @@
name = Coding;
sourceTree = "";
};
+ E1B6E180E8EDFB2628E63A69 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ D25764811A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig */,
+ D25764821A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig */,
+ 6D26BF271C6D22AC83FE7ED4 /* Pods-PersistentModel Tests.debug.xcconfig */,
+ 0A919120130127B0DECF0C6E /* Pods-PersistentModel Tests.release.xcconfig */,
+ );
+ name = Pods;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- D26C2B3018BFB1CF00E8BE90 /* PersistentModelTest */ = {
+ D25764681A4075EA00C59CD1 /* PersistentModel Tests */ = {
isa = PBXNativeTarget;
- buildConfigurationList = D26C2B5D18BFB1D000E8BE90 /* Build configuration list for PBXNativeTarget "PersistentModelTest" */;
+ buildConfigurationList = D25764711A4075EA00C59CD1 /* Build configuration list for PBXNativeTarget "PersistentModel Tests" */;
+ buildPhases = (
+ 6208DAB72B97974BDF55A215 /* Check Pods Manifest.lock */,
+ D25764651A4075EA00C59CD1 /* Sources */,
+ D25764661A4075EA00C59CD1 /* Frameworks */,
+ D25764671A4075EA00C59CD1 /* Resources */,
+ 4132F9E152A5B218C3C6BCCA /* Copy Pods Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ D25764701A4075EA00C59CD1 /* PBXTargetDependency */,
+ );
+ name = "PersistentModel Tests";
+ productName = "PersistentModel Tests";
+ productReference = D25764691A4075EA00C59CD1 /* PersistentModel Tests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+ D26C2B3018BFB1CF00E8BE90 /* PersistentModel */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D26C2B5D18BFB1D000E8BE90 /* Build configuration list for PBXNativeTarget "PersistentModel" */;
buildPhases = (
B973AFB7A97C41AFB830DFA7 /* Check Pods Manifest.lock */,
D26C2B2D18BFB1CF00E8BE90 /* Sources */,
@@ -225,9 +315,9 @@
);
dependencies = (
);
- name = PersistentModelTest;
- productName = PersistentModelTest;
- productReference = D26C2B3118BFB1CF00E8BE90 /* PersistentModelTest.app */;
+ name = PersistentModel;
+ productName = PersistentModel;
+ productReference = D26C2B3118BFB1CF00E8BE90 /* PersistentModel.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -240,12 +330,16 @@
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "Joan Martin";
TargetAttributes = {
+ D25764681A4075EA00C59CD1 = {
+ CreatedOnToolsVersion = 6.1.1;
+ TestTargetID = D26C2B3018BFB1CF00E8BE90;
+ };
D26C2B3018BFB1CF00E8BE90 = {
DevelopmentTeam = 3VP5WS89TZ;
};
};
};
- buildConfigurationList = D26C2B2C18BFB1CF00E8BE90 /* Build configuration list for PBXProject "PersistentModelTest" */;
+ buildConfigurationList = D26C2B2C18BFB1CF00E8BE90 /* Build configuration list for PBXProject "PersistentModel" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -257,16 +351,26 @@
projectDirPath = "";
projectRoot = "";
targets = (
- D26C2B3018BFB1CF00E8BE90 /* PersistentModelTest */,
+ D26C2B3018BFB1CF00E8BE90 /* PersistentModel */,
+ D25764681A4075EA00C59CD1 /* PersistentModel Tests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ D25764671A4075EA00C59CD1 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
D26C2B2F18BFB1CF00E8BE90 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ D25764841A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig in Resources */,
+ D25764831A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig in Resources */,
D26C2B3F18BFB1CF00E8BE90 /* InfoPlist.strings in Resources */,
D26C2B4718BFB1CF00E8BE90 /* Images.xcassets in Resources */,
);
@@ -275,6 +379,36 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
+ 4132F9E152A5B218C3C6BCCA /* Copy Pods Resources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy Pods Resources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PersistentModel Tests/Pods-PersistentModel Tests-resources.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 6208DAB72B97974BDF55A215 /* Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Check Pods Manifest.lock";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
+ showEnvVarsInLog = 0;
+ };
9234CD052F4A472FBA2D9980 /* Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -287,7 +421,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n";
+ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PersistentModel/Pods-PersistentModel-resources.sh\"\n";
showEnvVarsInLog = 0;
};
B973AFB7A97C41AFB830DFA7 /* Check Pods Manifest.lock */ = {
@@ -308,6 +442,25 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ D25764651A4075EA00C59CD1 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D25764771A40776D00C59CD1 /* PMFetchRequest.m in Sources */,
+ D25764781A40776D00C59CD1 /* PMKeyedArchiver.m in Sources */,
+ D25764761A40776D00C59CD1 /* PMObjectID.m in Sources */,
+ D257647B1A40776D00C59CD1 /* PMPersistentObject.m in Sources */,
+ D25764791A40776D00C59CD1 /* PMKeyedUnarchiver.m in Sources */,
+ D25764741A40776D00C59CD1 /* PMBaseObject.m in Sources */,
+ D257647E1A40776D00C59CD1 /* PMSQLiteStore.m in Sources */,
+ D25764751A40776D00C59CD1 /* PMObjectContext.m in Sources */,
+ D257647D1A40776D00C59CD1 /* PMSQLiteObject.m in Sources */,
+ D257647A1A40776D00C59CD1 /* PMObjectIndex.m in Sources */,
+ D257646E1A4075EA00C59CD1 /* PersistentModel_Tests.m in Sources */,
+ D257647C1A40776D00C59CD1 /* PMPersistentStore.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
D26C2B2D18BFB1CF00E8BE90 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -323,7 +476,6 @@
D29B88D919E2EC5A00361F24 /* PMKeyedUnarchiver.m in Sources */,
D201AA1B18DC75E600E5F26D /* PMBaseObject.m in Sources */,
D29B88D619E2EBCA00361F24 /* PMKeyedArchiver.m in Sources */,
- D226129F1A35B8AF00EFBF83 /* NSArray+PMBaseObject.m in Sources */,
D201AA2018DC75E600E5F26D /* PMSQLiteStore.m in Sources */,
D201AA2618DC7C6E00E5F26D /* PMUser.m in Sources */,
D2C986BD19DAB8F300043329 /* PMObjectID.m in Sources */,
@@ -333,6 +485,14 @@
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ D25764701A4075EA00C59CD1 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = D26C2B3018BFB1CF00E8BE90 /* PersistentModel */;
+ targetProxy = D257646F1A4075EA00C59CD1 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin PBXVariantGroup section */
D26C2B3D18BFB1CF00E8BE90 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
@@ -345,6 +505,60 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ D25764721A4075EA00C59CD1 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 6D26BF271C6D22AC83FE7ED4 /* Pods-PersistentModel Tests.debug.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = "PersistentModel Tests/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.1;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Pods/build/Debug-iphoneos",
+ );
+ MTL_ENABLE_DEBUG_INFO = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PersistentModel.app/PersistentModel";
+ };
+ name = Debug;
+ };
+ D25764731A4075EA00C59CD1 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 0A919120130127B0DECF0C6E /* Pods-PersistentModel Tests.release.xcconfig */;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = "PersistentModel Tests/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 8.1;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Pods/build/Debug-iphoneos",
+ );
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PersistentModel.app/PersistentModel";
+ };
+ name = Release;
+ };
D26C2B5B18BFB1D000E8BE90 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -417,30 +631,30 @@
};
D26C2B5E18BFB1D000E8BE90 /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 269C608F53274FD0AC433315 /* Pods.xcconfig */;
+ baseConfigurationReference = D25764811A407AE500C59CD1 /* Pods-PersistentModel.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "PersistentModelTest/PersistentModelTest-Prefix.pch";
- INFOPLIST_FILE = "PersistentModelTest/PersistentModelTest-Info.plist";
- PRODUCT_NAME = "$(TARGET_NAME)";
+ GCC_PREFIX_HEADER = "PersistentModel/PersistentModel-Prefix.pch";
+ INFOPLIST_FILE = "PersistentModel/PersistentModel-Info.plist";
+ PRODUCT_NAME = PersistentModel;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
D26C2B5F18BFB1D000E8BE90 /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 269C608F53274FD0AC433315 /* Pods.xcconfig */;
+ baseConfigurationReference = D25764821A407AE500C59CD1 /* Pods-PersistentModel.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "PersistentModelTest/PersistentModelTest-Prefix.pch";
- INFOPLIST_FILE = "PersistentModelTest/PersistentModelTest-Info.plist";
- PRODUCT_NAME = "$(TARGET_NAME)";
+ GCC_PREFIX_HEADER = "PersistentModel/PersistentModel-Prefix.pch";
+ INFOPLIST_FILE = "PersistentModel/PersistentModel-Info.plist";
+ PRODUCT_NAME = PersistentModel;
WRAPPER_EXTENSION = app;
};
name = Release;
@@ -448,7 +662,16 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- D26C2B2C18BFB1CF00E8BE90 /* Build configuration list for PBXProject "PersistentModelTest" */ = {
+ D25764711A4075EA00C59CD1 /* Build configuration list for PBXNativeTarget "PersistentModel Tests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D25764721A4075EA00C59CD1 /* Debug */,
+ D25764731A4075EA00C59CD1 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ D26C2B2C18BFB1CF00E8BE90 /* Build configuration list for PBXProject "PersistentModel" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D26C2B5B18BFB1D000E8BE90 /* Debug */,
@@ -457,7 +680,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- D26C2B5D18BFB1D000E8BE90 /* Build configuration list for PBXNativeTarget "PersistentModelTest" */ = {
+ D26C2B5D18BFB1D000E8BE90 /* Build configuration list for PBXNativeTarget "PersistentModel" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D26C2B5E18BFB1D000E8BE90 /* Debug */,
diff --git a/PersistentModelTest/PersistentModelTest/Images.xcassets/AppIcon.appiconset/Contents.json b/PersistentModel/PersistentModel/Images.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from PersistentModelTest/PersistentModelTest/Images.xcassets/AppIcon.appiconset/Contents.json
rename to PersistentModel/PersistentModel/Images.xcassets/AppIcon.appiconset/Contents.json
diff --git a/PersistentModelTest/PersistentModelTest/Images.xcassets/LaunchImage.launchimage/Contents.json b/PersistentModel/PersistentModel/Images.xcassets/LaunchImage.launchimage/Contents.json
similarity index 100%
rename from PersistentModelTest/PersistentModelTest/Images.xcassets/LaunchImage.launchimage/Contents.json
rename to PersistentModel/PersistentModel/Images.xcassets/LaunchImage.launchimage/Contents.json
diff --git a/PersistentModelTest/PersistentModelTest/PMAppDelegate.h b/PersistentModel/PersistentModel/PMAppDelegate.h
similarity index 91%
rename from PersistentModelTest/PersistentModelTest/PMAppDelegate.h
rename to PersistentModel/PersistentModel/PMAppDelegate.h
index 3b5d66a..1eeda8d 100644
--- a/PersistentModelTest/PersistentModelTest/PMAppDelegate.h
+++ b/PersistentModel/PersistentModel/PMAppDelegate.h
@@ -1,6 +1,6 @@
//
// PMAppDelegate.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 27/02/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/PersistentModelTest/PersistentModelTest/PMAppDelegate.m b/PersistentModel/PersistentModel/PMAppDelegate.m
similarity index 99%
rename from PersistentModelTest/PersistentModelTest/PMAppDelegate.m
rename to PersistentModel/PersistentModel/PMAppDelegate.m
index b6c1264..f9c09aa 100644
--- a/PersistentModelTest/PersistentModelTest/PMAppDelegate.m
+++ b/PersistentModel/PersistentModel/PMAppDelegate.m
@@ -1,6 +1,6 @@
//
// PMAppDelegate.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 27/02/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/PersistentModelTest/PersistentModelTest/PMUser.h b/PersistentModel/PersistentModel/PMUser.h
similarity index 93%
rename from PersistentModelTest/PersistentModelTest/PMUser.h
rename to PersistentModel/PersistentModel/PMUser.h
index 7f38073..bca24c3 100644
--- a/PersistentModelTest/PersistentModelTest/PMUser.h
+++ b/PersistentModel/PersistentModel/PMUser.h
@@ -1,6 +1,6 @@
//
// PMUser.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 21/03/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/PersistentModelTest/PersistentModelTest/PMUser.m b/PersistentModel/PersistentModel/PMUser.m
similarity index 77%
rename from PersistentModelTest/PersistentModelTest/PMUser.m
rename to PersistentModel/PersistentModel/PMUser.m
index b4e281a..c473cb2 100644
--- a/PersistentModelTest/PersistentModelTest/PMUser.m
+++ b/PersistentModel/PersistentModel/PMUser.m
@@ -1,6 +1,6 @@
//
// PMUser.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 21/03/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
@@ -12,9 +12,9 @@ @implementation PMUser
+ (NSArray*)pmd_persistentPropertyNames
{
- return @[mjz_key(username),
- mjz_key(age),
- mjz_key(avatarURL),
+ return @[pmd_key(username),
+ pmd_key(age),
+ pmd_key(avatarURL),
];
}
diff --git a/PersistentModelTest/PersistentModelTest/PMVideo.h b/PersistentModel/PersistentModel/PMVideo.h
similarity index 93%
rename from PersistentModelTest/PersistentModelTest/PMVideo.h
rename to PersistentModel/PersistentModel/PMVideo.h
index 7e28a7c..4603160 100644
--- a/PersistentModelTest/PersistentModelTest/PMVideo.h
+++ b/PersistentModel/PersistentModel/PMVideo.h
@@ -1,6 +1,6 @@
//
// PMVideo.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 21/03/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/PersistentModelTest/PersistentModelTest/PMVideo.m b/PersistentModel/PersistentModel/PMVideo.m
similarity index 81%
rename from PersistentModelTest/PersistentModelTest/PMVideo.m
rename to PersistentModel/PersistentModel/PMVideo.m
index 7e1a45e..6ed8f49 100644
--- a/PersistentModelTest/PersistentModelTest/PMVideo.m
+++ b/PersistentModel/PersistentModel/PMVideo.m
@@ -1,6 +1,6 @@
//
// PMVideo.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 21/03/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
@@ -13,8 +13,8 @@ @implementation PMVideo
+ (NSArray*)pmd_persistentPropertyNames
{
- return @[mjz_key(title),
- mjz_key(uploaderID),
+ return @[pmd_key(title),
+ pmd_key(uploaderID),
];
}
diff --git a/PersistentModelTest/PersistentModelTest/PersistentModelTest-Info.plist b/PersistentModel/PersistentModel/PersistentModel-Info.plist
similarity index 94%
rename from PersistentModelTest/PersistentModelTest/PersistentModelTest-Info.plist
rename to PersistentModel/PersistentModel/PersistentModel-Info.plist
index 25dd524..7fa8944 100644
--- a/PersistentModelTest/PersistentModelTest/PersistentModelTest-Info.plist
+++ b/PersistentModel/PersistentModel/PersistentModel-Info.plist
@@ -9,7 +9,7 @@
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
- com.vilanovi.${PRODUCT_NAME:rfc1034identifier}
+ com.mobilejazz.$(PRODUCT_NAME:rfc1034identifier)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
diff --git a/PersistentModelTest/PersistentModelTest/PersistentModelTest-Prefix.pch b/PersistentModel/PersistentModel/PersistentModel-Prefix.pch
similarity index 100%
rename from PersistentModelTest/PersistentModelTest/PersistentModelTest-Prefix.pch
rename to PersistentModel/PersistentModel/PersistentModel-Prefix.pch
diff --git a/PersistentModelTest/PersistentModelTest/en.lproj/InfoPlist.strings b/PersistentModel/PersistentModel/en.lproj/InfoPlist.strings
similarity index 100%
rename from PersistentModelTest/PersistentModelTest/en.lproj/InfoPlist.strings
rename to PersistentModel/PersistentModel/en.lproj/InfoPlist.strings
diff --git a/PersistentModelTest/PersistentModelTest/main.m b/PersistentModel/PersistentModel/main.m
similarity index 93%
rename from PersistentModelTest/PersistentModelTest/main.m
rename to PersistentModel/PersistentModel/main.m
index 4f6d499..699e815 100644
--- a/PersistentModelTest/PersistentModelTest/main.m
+++ b/PersistentModel/PersistentModel/main.m
@@ -1,6 +1,6 @@
//
// main.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 27/02/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/PersistentModel/Podfile b/PersistentModel/Podfile
new file mode 100644
index 0000000..0c72140
--- /dev/null
+++ b/PersistentModel/Podfile
@@ -0,0 +1,10 @@
+# Uncomment this line to define a global platform for your project
+# platform :ios, "6.0"
+
+target 'PersistentModel' do
+ pod 'FMDB', '~> 2.2'
+end
+
+target 'PersistentModel Tests' do
+ pod 'FMDB', '~> 2.2'
+end
\ No newline at end of file
diff --git a/PersistentModelTest/Podfile.lock b/PersistentModel/Podfile.lock
similarity index 80%
rename from PersistentModelTest/Podfile.lock
rename to PersistentModel/Podfile.lock
index 1c8db5c..573687a 100644
--- a/PersistentModelTest/Podfile.lock
+++ b/PersistentModel/Podfile.lock
@@ -1,6 +1,6 @@
PODS:
- FMDB (2.2):
- - FMDB/standard
+ - FMDB/standard (= 2.2)
- FMDB/common (2.2)
- FMDB/standard (2.2):
- FMDB/common
@@ -11,4 +11,4 @@ DEPENDENCIES:
SPEC CHECKSUMS:
FMDB: f6f4511ad1e9ace38e9b6f4d83c2cddaabf98ea6
-COCOAPODS: 0.33.1
+COCOAPODS: 0.35.0
diff --git a/PersistentModelTest/Podfile b/PersistentModelTest/Podfile
deleted file mode 100644
index 9d1b60f..0000000
--- a/PersistentModelTest/Podfile
+++ /dev/null
@@ -1,4 +0,0 @@
-# Uncomment this line to define a global platform for your project
-# platform :ios, "6.0"
-
-pod 'FMDB', '~> 2.2'
\ No newline at end of file
diff --git a/Source/NSArray+PMBaseObject.h b/Source/NSArray+PMBaseObject.h
deleted file mode 100644
index 7f8db7f..0000000
--- a/Source/NSArray+PMBaseObject.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// NSArray+PMBaseObject.h
-// PersistentModelTest
-//
-// Created by Joan Martin on 08/12/14.
-// Copyright (c) 2014 Joan Martin. All rights reserved.
-//
-
-#import
-
-extern NSString * const PMDInvalidObjectException;
-
-@interface NSArray (PMBaseObject)
-
-/**
- * Add an index to the current objects conained in the array (keeping the order).
- * @param index The index to add.
- * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
- **/
-- (void)pmd_addIndex:(NSString*)index;
-
-/**
- * Remove an index from all objects on the array.
- * @param index The index to add.
- * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
- **/
-- (void)pmd_removeIndex:(NSString*)index;
-
-@end
diff --git a/Source/NSArray+PMBaseObject.m b/Source/NSArray+PMBaseObject.m
deleted file mode 100644
index 1188984..0000000
--- a/Source/NSArray+PMBaseObject.m
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// NSArray+PMBaseObject.m
-// PersistentModelTest
-//
-// Created by Joan Martin on 08/12/14.
-// Copyright (c) 2014 Joan Martin. All rights reserved.
-//
-
-#import "NSArray+PMBaseObject.h"
-#import "PMBaseObject.h"
-
-NSString * const PMDInvalidObjectException = @"PMDInvalidObjectException";
-
-@implementation NSArray (PMBaseObject)
-
-- (void)pmd_addIndex:(NSString*)index
-{
- [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
-
- if ([obj isKindOfClass:PMBaseObject.class])
- {
- [obj addIndex:index order:idx];
- }
- else
- {
- NSException *exception = [NSException exceptionWithName:PMDInvalidObjectException
- reason:[NSString stringWithFormat:@"You cannot add an index to an object of class %@", obj.class]
- userInfo:nil];
-
- [exception raise];
- }
- }];
-}
-
-- (void)pmd_removeIndex:(NSString*)index
-{
- [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
- if ([obj isKindOfClass:PMBaseObject.class])
- {
- [obj removeIndex:index];
- }
- else
- {
- NSException *exception = [NSException exceptionWithName:PMDInvalidObjectException
- reason:[NSString stringWithFormat:@"You cannot remove an index to an object of class %@", obj.class]
- userInfo:nil];
-
- [exception raise];
- }
- }];
-}
-
-@end
diff --git a/Source/PMBaseObject.h b/Source/PMBaseObject.h
index 88b282b..0826242 100644
--- a/Source/PMBaseObject.h
+++ b/Source/PMBaseObject.h
@@ -33,12 +33,12 @@ extern NSString * const PMBaseObjectNilKeyException;
* Superclass of persistent objects. Persistent objects will have to be a subclass of this one.
*
* In order to persist properties, you can choose between:
- * 1. Manually encode and decode your properties using the NSCoding protocol methods
+ * 1. Manually encode and decode your properties using the NSCoding protocol methods.
* 2. Override the method `keysForPersistentValues` and return a set of strings with the names of those properties you want to persist. Values will be retrieved using KVC.
+ * 3. Do a mixture of options 1 and 2.
**/
@interface PMBaseObject : NSObject
-
/** ---------------------------------------------------------------- **
* @name Creating instances and initializing
** ---------------------------------------------------------------- **/
@@ -114,14 +114,94 @@ extern NSString * const PMBaseObjectNilKeyException;
@end
-#define mjz_key(arg) NSStringFromSelector(@selector(arg))
+#define pmd_key(arg) NSStringFromSelector(@selector(arg))
@interface PMBaseObject (Subclassing)
/**
- * Set of property names that are automatically persistent via KVC access.
- * @discussion Subclasses may override this method to mark those properties to be persistent. Values will be accessed via KVC. By default this class returns an empty set.
+ * Convinience method to define the names of the properties that must be persisted.
+ * @discussion Subclasses may override this method to mark those properties to be persistent. Property values will be accessed via KVC. By default this class returns an empty set.
**/
+ (NSArray*)pmd_persistentPropertyNames;
@end
+
+#pragma mark - Extensions
+
+extern NSString * const PMInvalidObjectException;
+
+/**
+ * Extending `NSArray` to be used with `PMBaseObject`s.
+ **/
+@interface NSArray (PMBaseObject)
+
+/** ---------------------------------------------------------------- **
+ * @name Adding index to objects
+ ** ---------------------------------------------------------------- **/
+
+/**
+ * Add an index to the current objects conained in the array (keeping the order).
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsAddIndex:(NSString*)index;
+
+/**
+ * Remove an index from all objects on the array.
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index;
+
+@end
+
+/**
+ * Extending `NSSet` to be used with `PMBaseObject`s.
+ **/
+@interface NSSet (PMBaseObject)
+
+/** ---------------------------------------------------------------- **
+ * @name Adding index to objects
+ ** ---------------------------------------------------------------- **/
+
+/**
+ * Add an index to the current objects conained in the set.
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsAddIndex:(NSString*)index;
+
+/**
+ * Remove an index from all objects on the set.
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index;
+
+@end
+
+/**
+ * Extending `NSOrderedSet` to be used with `PMBaseObject`s.
+ **/
+@interface NSOrderedSet (PMBaseObject)
+
+/** ---------------------------------------------------------------- **
+ * @name Adding index to objects
+ ** ---------------------------------------------------------------- **/
+
+/**
+ * Add an index to the current objects conained in the set (keeping the order).
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsAddIndex:(NSString*)index;
+
+/**
+ * Remove an index from all objects on the set.
+ * @param index The index to add.
+ * @discussion All objects must be of class `PMBaseObject`, otherwise this method will thorw an exception.
+ **/
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index;
+
+@end
+
diff --git a/Source/PMBaseObject.m b/Source/PMBaseObject.m
index a9e2bd5..b05cf1f 100644
--- a/Source/PMBaseObject.m
+++ b/Source/PMBaseObject.m
@@ -275,3 +275,134 @@ + (NSArray*)pmd_persistentPropertyNames
@end
+#pragma mark - Extensions
+
+NSString * const PMInvalidObjectException = @"PMInvalidObjectException";
+
+@implementation NSArray (PMBaseObject)
+
+- (void)pmd_makeObjectsAddIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj addIndex:index order:idx];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot add an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj removeIndex:index];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot remove an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+@end
+
+@implementation NSSet (PMBaseObject)
+
+- (void)pmd_makeObjectsAddIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj addIndex:index];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot add an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj removeIndex:index];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot remove an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+@end
+
+@implementation NSOrderedSet (PMBaseObject)
+
+- (void)pmd_makeObjectsAddIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj addIndex:index order:idx];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot add an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+- (void)pmd_makeObjectsRemoveIndex:(NSString*)index
+{
+ [self enumerateObjectsUsingBlock:^(PMBaseObject *obj, NSUInteger idx, BOOL *stop) {
+
+ if ([obj isKindOfClass:PMBaseObject.class])
+ {
+ [obj removeIndex:index];
+ }
+ else
+ {
+ NSException *exception = [NSException exceptionWithName:PMInvalidObjectException
+ reason:[NSString stringWithFormat:@"You cannot remove an index to an object of class %@", obj.class]
+ userInfo:nil];
+
+ [exception raise];
+ }
+ }];
+}
+
+@end
+
+
diff --git a/Source/PMBaseObject_Private.h b/Source/PMBaseObject_Private.h
index 61c1673..d9885ce 100644
--- a/Source/PMBaseObject_Private.h
+++ b/Source/PMBaseObject_Private.h
@@ -1,6 +1,6 @@
//
// PMBaseObject_Private.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 30/09/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMFetchRequest.h b/Source/PMFetchRequest.h
index ef00678..cdec191 100644
--- a/Source/PMFetchRequest.h
+++ b/Source/PMFetchRequest.h
@@ -1,6 +1,6 @@
//
// PMFetchRequest.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMFetchRequest.m b/Source/PMFetchRequest.m
index d3812ea..00f3dd4 100644
--- a/Source/PMFetchRequest.m
+++ b/Source/PMFetchRequest.m
@@ -1,6 +1,6 @@
//
// PMFetchRequest.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMKeyedArchiver.h b/Source/PMKeyedArchiver.h
index 2fe52cf..adae39e 100644
--- a/Source/PMKeyedArchiver.h
+++ b/Source/PMKeyedArchiver.h
@@ -1,6 +1,6 @@
//
// PMKeyedArchiver.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMKeyedArchiver.m b/Source/PMKeyedArchiver.m
index 1bfe9ca..cfbb0a0 100644
--- a/Source/PMKeyedArchiver.m
+++ b/Source/PMKeyedArchiver.m
@@ -1,6 +1,6 @@
//
// PMKeyedArchiver.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMKeyedUnarchiver.h b/Source/PMKeyedUnarchiver.h
index 1026c0b..dd08bb5 100644
--- a/Source/PMKeyedUnarchiver.h
+++ b/Source/PMKeyedUnarchiver.h
@@ -1,6 +1,6 @@
//
// PMKeyedUnarchiver.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMKeyedUnarchiver.m b/Source/PMKeyedUnarchiver.m
index 53ec686..44b19c2 100644
--- a/Source/PMKeyedUnarchiver.m
+++ b/Source/PMKeyedUnarchiver.m
@@ -1,6 +1,6 @@
//
// PMKeyedUnarchiver.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 06/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectContext_Private.h b/Source/PMObjectContext_Private.h
index 8d20e09..4f5535d 100644
--- a/Source/PMObjectContext_Private.h
+++ b/Source/PMObjectContext_Private.h
@@ -1,6 +1,6 @@
//
// PMObjectContext_Private.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 09/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectID.h b/Source/PMObjectID.h
index 2164c33..e1ef616 100644
--- a/Source/PMObjectID.h
+++ b/Source/PMObjectID.h
@@ -1,6 +1,6 @@
//
// PMObjectID.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 30/09/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectID.m b/Source/PMObjectID.m
index 84862b2..35a0ef0 100644
--- a/Source/PMObjectID.m
+++ b/Source/PMObjectID.m
@@ -1,6 +1,6 @@
//
// PMObjectID.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 30/09/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectID_Private.h b/Source/PMObjectID_Private.h
index ea22ab4..f3586a3 100644
--- a/Source/PMObjectID_Private.h
+++ b/Source/PMObjectID_Private.h
@@ -1,6 +1,6 @@
//
// PMObjectID_Private.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 30/09/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectIndex.h b/Source/PMObjectIndex.h
index f9b1fcb..31166cd 100644
--- a/Source/PMObjectIndex.h
+++ b/Source/PMObjectIndex.h
@@ -1,6 +1,6 @@
//
// PMObjectIndex.h
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 09/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMObjectIndex.m b/Source/PMObjectIndex.m
index d6169dc..8cea7b6 100644
--- a/Source/PMObjectIndex.m
+++ b/Source/PMObjectIndex.m
@@ -1,6 +1,6 @@
//
// PMObjectIndex.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 09/10/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMPersistentObject.m b/Source/PMPersistentObject.m
index f8169b5..800c1db 100644
--- a/Source/PMPersistentObject.m
+++ b/Source/PMPersistentObject.m
@@ -1,6 +1,6 @@
//
// PMPersistentObject.m
-// PersistentModelTest
+// PersistentModel
//
// Created by Joan Martin on 30/09/14.
// Copyright (c) 2014 Joan Martin. All rights reserved.
diff --git a/Source/PMSQLiteStore.m b/Source/PMSQLiteStore.m
index 1a3a00a..3138c76 100644
--- a/Source/PMSQLiteStore.m
+++ b/Source/PMSQLiteStore.m
@@ -8,7 +8,7 @@
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
-// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copiesœ
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
diff --git a/Source/PersistentModel.h b/Source/PersistentModel.h
index 5fa816d..92e1682 100644
--- a/Source/PersistentModel.h
+++ b/Source/PersistentModel.h
@@ -20,7 +20,6 @@
#import "PMObjectID.h"
#import "PMBaseObject.h"
-#import "NSArray+PMBaseObject.h"
#import "PMObjectContext.h"
#import "PMPersistentStore.h"