Add example application for Core Data search support

This commit is contained in:
Blake Watters
2012-08-14 09:56:20 -04:00
parent 39b0df4c39
commit 7bd47a7dac
13 changed files with 869 additions and 0 deletions

View File

@@ -0,0 +1,459 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
2583C49C15D96D4000E05CAE /* contacts.json in Resources */ = {isa = PBXBuildFile; fileRef = 2583C49B15D96D4000E05CAE /* contacts.json */; };
259C7FFB15D20B5600F447D2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C7FFA15D20B5600F447D2 /* UIKit.framework */; };
259C7FFD15D20B5600F447D2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C7FFC15D20B5600F447D2 /* Foundation.framework */; };
259C7FFF15D20B5600F447D2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C7FFE15D20B5600F447D2 /* CoreGraphics.framework */; };
259C800515D20B5600F447D2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 259C800315D20B5600F447D2 /* InfoPlist.strings */; };
259C800715D20B5600F447D2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 259C800615D20B5600F447D2 /* main.m */; };
259C800B15D20B5600F447D2 /* RKSAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 259C800A15D20B5600F447D2 /* RKSAppDelegate.m */; };
259C800E15D20B5600F447D2 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 259C800C15D20B5600F447D2 /* MainStoryboard.storyboard */; };
259C801115D20B5600F447D2 /* RKSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 259C801015D20B5600F447D2 /* RKSViewController.m */; };
259C802E15D20BAA00F447D2 /* libRestKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C802315D20B7100F447D2 /* libRestKit.a */; };
259C803415D20BAA00F447D2 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C802F15D20BAA00F447D2 /* CFNetwork.framework */; };
259C803515D20BAA00F447D2 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803015D20BAA00F447D2 /* CoreData.framework */; };
259C803615D20BAA00F447D2 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803115D20BAA00F447D2 /* QuartzCore.framework */; };
259C803715D20BAA00F447D2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803215D20BAA00F447D2 /* Security.framework */; };
259C803815D20BAA00F447D2 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803315D20BAA00F447D2 /* SystemConfiguration.framework */; };
259C803A15D20C3500F447D2 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803915D20C3500F447D2 /* MobileCoreServices.framework */; };
259C803C15D20C4000F447D2 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 259C803B15D20C4000F447D2 /* libxml2.dylib */; };
25AA7D1415D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 25AA7D1215D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodeld */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
259C802215D20B7100F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 25160D1614564E810060A5C5;
remoteInfo = RestKit;
};
259C802415D20B7100F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 25160D2614564E820060A5C5;
remoteInfo = RestKitTests;
};
259C802615D20B7100F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 25160E62145651060060A5C5;
remoteInfo = RestKitFramework;
};
259C802815D20B7100F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 25160E78145651060060A5C5;
remoteInfo = RestKitFrameworkTests;
};
259C802A15D20B7100F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 259C301615128079003066A2;
remoteInfo = RestKitResources;
};
259C802C15D20B7B00F447D2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 25160D1514564E810060A5C5;
remoteInfo = RestKit;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
2583C49B15D96D4000E05CAE /* contacts.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contacts.json; sourceTree = "<group>"; };
259C7FF615D20B5600F447D2 /* RKSearchExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKSearchExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
259C7FFA15D20B5600F447D2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
259C7FFC15D20B5600F447D2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
259C7FFE15D20B5600F447D2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
259C800215D20B5600F447D2 /* RKSearchExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RKSearchExample-Info.plist"; sourceTree = "<group>"; };
259C800415D20B5600F447D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
259C800615D20B5600F447D2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
259C800815D20B5600F447D2 /* RKSearchExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RKSearchExample-Prefix.pch"; sourceTree = "<group>"; };
259C800915D20B5600F447D2 /* RKSAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RKSAppDelegate.h; sourceTree = "<group>"; };
259C800A15D20B5600F447D2 /* RKSAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RKSAppDelegate.m; sourceTree = "<group>"; };
259C800D15D20B5600F447D2 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
259C800F15D20B5600F447D2 /* RKSViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RKSViewController.h; sourceTree = "<group>"; };
259C801015D20B5600F447D2 /* RKSViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RKSViewController.m; sourceTree = "<group>"; };
259C801715D20B7100F447D2 /* RestKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RestKit.xcodeproj; path = ../../RestKit.xcodeproj; sourceTree = "<group>"; };
259C802F15D20BAA00F447D2 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
259C803015D20BAA00F447D2 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
259C803115D20BAA00F447D2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
259C803215D20BAA00F447D2 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
259C803315D20BAA00F447D2 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
259C803915D20C3500F447D2 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
259C803B15D20C4000F447D2 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
25AA7D1315D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = RKSearchExampleModel.xcdatamodel; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
259C7FF315D20B5600F447D2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
259C803C15D20C4000F447D2 /* libxml2.dylib in Frameworks */,
259C803A15D20C3500F447D2 /* MobileCoreServices.framework in Frameworks */,
259C803415D20BAA00F447D2 /* CFNetwork.framework in Frameworks */,
259C803515D20BAA00F447D2 /* CoreData.framework in Frameworks */,
259C803615D20BAA00F447D2 /* QuartzCore.framework in Frameworks */,
259C803715D20BAA00F447D2 /* Security.framework in Frameworks */,
259C803815D20BAA00F447D2 /* SystemConfiguration.framework in Frameworks */,
259C802E15D20BAA00F447D2 /* libRestKit.a in Frameworks */,
259C7FFF15D20B5600F447D2 /* CoreGraphics.framework in Frameworks */,
259C7FFB15D20B5600F447D2 /* UIKit.framework in Frameworks */,
259C7FFD15D20B5600F447D2 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
259C7FEB15D20B5600F447D2 = {
isa = PBXGroup;
children = (
259C800015D20B5600F447D2 /* RKSearchExample */,
259C7FF915D20B5600F447D2 /* Frameworks */,
259C7FF715D20B5600F447D2 /* Products */,
259C801715D20B7100F447D2 /* RestKit.xcodeproj */,
);
sourceTree = "<group>";
};
259C7FF715D20B5600F447D2 /* Products */ = {
isa = PBXGroup;
children = (
259C7FF615D20B5600F447D2 /* RKSearchExample.app */,
);
name = Products;
sourceTree = "<group>";
};
259C7FF915D20B5600F447D2 /* Frameworks */ = {
isa = PBXGroup;
children = (
259C803B15D20C4000F447D2 /* libxml2.dylib */,
259C803915D20C3500F447D2 /* MobileCoreServices.framework */,
259C803015D20BAA00F447D2 /* CoreData.framework */,
259C803115D20BAA00F447D2 /* QuartzCore.framework */,
259C803215D20BAA00F447D2 /* Security.framework */,
259C803315D20BAA00F447D2 /* SystemConfiguration.framework */,
259C802F15D20BAA00F447D2 /* CFNetwork.framework */,
259C7FFA15D20B5600F447D2 /* UIKit.framework */,
259C7FFC15D20B5600F447D2 /* Foundation.framework */,
259C7FFE15D20B5600F447D2 /* CoreGraphics.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
259C800015D20B5600F447D2 /* RKSearchExample */ = {
isa = PBXGroup;
children = (
2583C49B15D96D4000E05CAE /* contacts.json */,
259C800915D20B5600F447D2 /* RKSAppDelegate.h */,
259C800A15D20B5600F447D2 /* RKSAppDelegate.m */,
259C800C15D20B5600F447D2 /* MainStoryboard.storyboard */,
259C800F15D20B5600F447D2 /* RKSViewController.h */,
259C801015D20B5600F447D2 /* RKSViewController.m */,
25AA7D1215D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodeld */,
259C800115D20B5600F447D2 /* Supporting Files */,
);
path = RKSearchExample;
sourceTree = "<group>";
};
259C800115D20B5600F447D2 /* Supporting Files */ = {
isa = PBXGroup;
children = (
259C800215D20B5600F447D2 /* RKSearchExample-Info.plist */,
259C800315D20B5600F447D2 /* InfoPlist.strings */,
259C800615D20B5600F447D2 /* main.m */,
259C800815D20B5600F447D2 /* RKSearchExample-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
259C801815D20B7100F447D2 /* Products */ = {
isa = PBXGroup;
children = (
259C802315D20B7100F447D2 /* libRestKit.a */,
259C802515D20B7100F447D2 /* RestKitTests.octest */,
259C802715D20B7100F447D2 /* RestKit.framework */,
259C802915D20B7100F447D2 /* RestKitFrameworkTests.octest */,
259C802B15D20B7100F447D2 /* RestKitResources.bundle */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
259C7FF515D20B5600F447D2 /* RKSearchExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 259C801415D20B5600F447D2 /* Build configuration list for PBXNativeTarget "RKSearchExample" */;
buildPhases = (
259C7FF215D20B5600F447D2 /* Sources */,
259C7FF315D20B5600F447D2 /* Frameworks */,
259C7FF415D20B5600F447D2 /* Resources */,
);
buildRules = (
);
dependencies = (
259C802D15D20B7B00F447D2 /* PBXTargetDependency */,
);
name = RKSearchExample;
productName = RKSearchExample;
productReference = 259C7FF615D20B5600F447D2 /* RKSearchExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
259C7FED15D20B5600F447D2 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = RKS;
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Blake Watters";
};
buildConfigurationList = 259C7FF015D20B5600F447D2 /* Build configuration list for PBXProject "RKSearchExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 259C7FEB15D20B5600F447D2;
productRefGroup = 259C7FF715D20B5600F447D2 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 259C801815D20B7100F447D2 /* Products */;
ProjectRef = 259C801715D20B7100F447D2 /* RestKit.xcodeproj */;
},
);
projectRoot = "";
targets = (
259C7FF515D20B5600F447D2 /* RKSearchExample */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
259C802315D20B7100F447D2 /* libRestKit.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRestKit.a;
remoteRef = 259C802215D20B7100F447D2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
259C802515D20B7100F447D2 /* RestKitTests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = RestKitTests.octest;
remoteRef = 259C802415D20B7100F447D2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
259C802715D20B7100F447D2 /* RestKit.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = RestKit.framework;
remoteRef = 259C802615D20B7100F447D2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
259C802915D20B7100F447D2 /* RestKitFrameworkTests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = RestKitFrameworkTests.octest;
remoteRef = 259C802815D20B7100F447D2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
259C802B15D20B7100F447D2 /* RestKitResources.bundle */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = RestKitResources.bundle;
remoteRef = 259C802A15D20B7100F447D2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
259C7FF415D20B5600F447D2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
259C800515D20B5600F447D2 /* InfoPlist.strings in Resources */,
259C800E15D20B5600F447D2 /* MainStoryboard.storyboard in Resources */,
2583C49C15D96D4000E05CAE /* contacts.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
259C7FF215D20B5600F447D2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
259C800715D20B5600F447D2 /* main.m in Sources */,
259C800B15D20B5600F447D2 /* RKSAppDelegate.m in Sources */,
259C801115D20B5600F447D2 /* RKSViewController.m in Sources */,
25AA7D1415D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodeld in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
259C802D15D20B7B00F447D2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = RestKit;
targetProxy = 259C802C15D20B7B00F447D2 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
259C800315D20B5600F447D2 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
259C800415D20B5600F447D2 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
259C800C15D20B5600F447D2 /* MainStoryboard.storyboard */ = {
isa = PBXVariantGroup;
children = (
259C800D15D20B5600F447D2 /* en */,
);
name = MainStoryboard.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
259C801215D20B5600F447D2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
SDKROOT = iphoneos;
};
name = Debug;
};
259C801315D20B5600F447D2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
259C801515D20B5600F447D2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RKSearchExample/RKSearchExample-Prefix.pch";
HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/../../Headers\"";
INFOPLIST_FILE = "RKSearchExample/RKSearchExample-Info.plist";
OTHER_LDFLAGS = (
"-ObjC",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
259C801615D20B5600F447D2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RKSearchExample/RKSearchExample-Prefix.pch";
HEADER_SEARCH_PATHS = "\"$(BUILT_PRODUCTS_DIR)/../../Headers\"";
INFOPLIST_FILE = "RKSearchExample/RKSearchExample-Info.plist";
OTHER_LDFLAGS = (
"-ObjC",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
259C7FF015D20B5600F447D2 /* Build configuration list for PBXProject "RKSearchExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
259C801215D20B5600F447D2 /* Debug */,
259C801315D20B5600F447D2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
259C801415D20B5600F447D2 /* Build configuration list for PBXNativeTarget "RKSearchExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
259C801515D20B5600F447D2 /* Debug */,
259C801615D20B5600F447D2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
25AA7D1215D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
25AA7D1315D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodel */,
);
currentVersion = 25AA7D1315D4C3A700A1B4E7 /* RKSearchExampleModel.xcdatamodel */;
path = RKSearchExampleModel.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 259C7FED15D20B5600F447D2 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:RKSearchExample.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,17 @@
//
// RKSAppDelegate.h
// RKSearchExample
//
// Created by Blake Watters on 8/7/12.
// Copyright (c) 2012 Blake Watters. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <RestKit/RestKit.h>
@interface RKSAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) RKManagedObjectStore *managedObjectStore;
@end

View File

@@ -0,0 +1,58 @@
//
// RKSAppDelegate.m
// RKSearchExample
//
// Created by Blake Watters on 8/7/12.
// Copyright (c) 2012 Blake Watters. All rights reserved.
//
#import <RestKit/Search.h>
#import "RKSAppDelegate.h"
@implementation RKSAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Turn on logging for the Search component
RKLogConfigureByName("RestKit/Search", RKLogLevelTrace);
// Initialize the managed object store
NSManagedObjectModel *managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
// Configure the Contact entity for mapping
RKEntityMapping *contactMapping = [RKEntityMapping mappingForEntityForName:@"Contact" inManagedObjectStore:managedObjectStore];
[contactMapping addAttributeMappingsFromDictionary:@{
@"first_name" : @"firstName",
@"last_name": @"lastName",
@"email_adddress": @"emailAddress",
@"phone_number": @"phoneNumber",
@"notes": @"notes" }];
// Configure search indexing
[managedObjectStore addSearchIndexingToEntityForName:@"Contact"
onAttributes:@[ @"firstName", @"lastName", @"emailAddress", @"phoneNumber", @"notes"]];
// Finalize Core Data initialization
NSError *error = nil;
NSPersistentStore *persistentStore = [managedObjectStore addInMemoryPersistentStore:&error];
NSAssert(persistentStore, @"Failed to create persistent store: %@", error);
[managedObjectStore createManagedObjectContexts];
// Import searchable content from a JSON file
RKManagedObjectImporter *importer = [[RKManagedObjectImporter alloc] initWithPersistentStore:persistentStore];
NSString *pathToDataFile = [[NSBundle mainBundle] pathForResource:@"contacts" ofType:@"json"];
NSUInteger count = [importer importObjectsFromItemAtPath:pathToDataFile withMapping:contactMapping keyPath:@"contacts" error:&error];
NSAssert(count != NSNotFound, @"Failed to import contacts at path '%@': %@", pathToDataFile, error);
// Index the imported objects
[managedObjectStore.searchIndexer indexChangedObjectsInManagedObjectContext:importer.managedObjectContext];
BOOL success = [importer finishImporting:&error];
NSAssert(success, @"Failed to finish import operation: %@", error);
self.managedObjectStore = managedObjectStore;
return YES;
}
@end

View File

@@ -0,0 +1,13 @@
//
// RKSViewController.h
// RKSearchExample
//
// Created by Blake Watters on 8/7/12.
// Copyright (c) 2012 Blake Watters. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RKSViewController : UITableViewController
@end

View File

@@ -0,0 +1,140 @@
//
// RKSViewController.m
// RKSearchExample
//
// Created by Blake Watters on 8/7/12.
// Copyright (c) 2012 Blake Watters. All rights reserved.
//
#import <RestKit/Search.h>
#import <CoreData/CoreData.h>
#import "RKSAppDelegate.h"
#import "RKSViewController.h"
@interface RKSViewController () <UISearchDisplayDelegate, NSFetchedResultsControllerDelegate>
@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, strong) NSFetchedResultsController *searchFetchedResultsController;
@end
@implementation RKSViewController
- (void)viewDidLoad
{
[super viewDidLoad];
RKManagedObjectStore *managedObjectStore = [(RKSAppDelegate *)[UIApplication sharedApplication].delegate managedObjectStore];
self.managedObjectContext = managedObjectStore.mainQueueManagedObjectContext;
NSError *error = nil;
self.fetchedResultsController = [self newFetchedResultsController];
BOOL success = [self.fetchedResultsController performFetch:&error];
NSAssert(success, @"Failed to perform fetch: %@", error);
}
- (NSFetchedResultsController *)newFetchedResultsController
{
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Contact"];
fetchRequest.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES] ];
NSFetchedResultsController *fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
managedObjectContext:self.managedObjectContext
sectionNameKeyPath:nil
cacheName:nil];
fetchedResultsController.delegate = self;
return fetchedResultsController;
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if (tableView == self.tableView) {
return [[self.fetchedResultsController sections] count];
} else if (tableView == self.searchDisplayController.searchResultsTableView) {
return [[self.searchFetchedResultsController sections] count];
}
return NSNotFound;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView == self.tableView) {
return [[[self.fetchedResultsController sections] objectAtIndex:section] numberOfObjects];
} else if (tableView == self.searchDisplayController.searchResultsTableView) {
return [[[self.searchFetchedResultsController sections] objectAtIndex:section] numberOfObjects];
}
return NSNotFound;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"ContactCell";
UITableViewCell *cell = nil;
if ([tableView isEqual:self.tableView]) {
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
} else if ([tableView isEqual:self.searchDisplayController.searchResultsTableView]) {
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:cellIdentifier];
}
}
NSManagedObject *managedObject = nil;
if (tableView == self.tableView) {
managedObject = [_fetchedResultsController objectAtIndexPath:indexPath];
} else if (tableView == self.searchDisplayController.searchResultsTableView) {
managedObject = [_searchFetchedResultsController objectAtIndexPath:indexPath];
}
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", [managedObject valueForKey:@"firstName"], [managedObject valueForKey:@"lastName"]];
cell.detailTextLabel.text = [managedObject valueForKey:@"phoneNumber"];
return cell;
}
#pragma mark - NSFetchedResultsControllerDelegate
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
{
if (controller == self.fetchedResultsController) {
[self.tableView beginUpdates];
} else if (controller == self.searchFetchedResultsController) {
[self.searchDisplayController.searchResultsTableView beginUpdates];
}
}
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{
if (controller == self.fetchedResultsController) {
[self.tableView endUpdates];
} else if (controller == self.searchFetchedResultsController) {
[self.searchDisplayController.searchResultsTableView endUpdates];
}
}
#pragma mark - UISearchDisplayDelegate
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller
{
self.searchFetchedResultsController = [self newFetchedResultsController];
}
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller
{
self.searchFetchedResultsController = nil;
}
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
NSPredicate *predicate = [RKSearchPredicate searchPredicateWithText:searchString type:NSAndPredicateType];
self.searchFetchedResultsController.fetchRequest.predicate = predicate;
NSError *error = nil;
[self.searchFetchedResultsController performFetch:&error];
return YES;
}
@end

View File

@@ -0,0 +1,40 @@
<?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>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.restkit.${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>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'RKSearchExample' target in the 'RKSearchExample' project
//
#import <Availability.h>
#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1807" systemVersion="12A269" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Contact" syncable="YES">
<attribute name="emailAddress" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="firstName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="lastName" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="notes" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="phoneNumber" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<elements>
<element name="Contact" positionX="160" positionY="192" width="128" height="120"/>
</elements>
</model>

View File

@@ -0,0 +1,9 @@
{"contacts":[{"first_name": "Lee", "last_name": "Adama", "phone_number": "616-555-4280", "email_address": "apollo@bsg.org", "notes": "Commander's son"},
{"first_name": "Karl", "last_name": "Agathon", "phone_number": "616-555-1121", "email_address": "helo@bsg.org", "notes": "Cylon lover"},
{"first_name": "Galen", "last_name": "Tyrol", "phone_number": "769-555-8281", "email_address": "chief@bsg.org", "notes": "Secret Cylon"},
{"first_name": "Number", "last_name": "Six", "phone_number": "635-555-9900", "email_address": "six@cylons.org", "notes": "Blatant Cylon"},
{"first_name": "Gaius", "last_name": "Baltar", "phone_number": "864-555-7591", "email_address": "gaius@bsg.org", "notes": "Coward"},
{"first_name": "William", "last_name": "Adama", "phone_number": "414-555-9812", "email_address": "husker@bsg.org", "notes": "Certified bad ass"},
{"first_name": "Kara", "last_name": "Thrace", "phone_number": "221-555-9017", "email_address": "starbuck@bsg.org", "notes": "Viper pilot extraordinaire"},
{"first_name": "Laura", "last_name": "Roslin", "phone_number": "775-555-0891", "email_address": "prez@colonialone.org", "notes": "Secretary of Education turned leader"},
{"first_name": "Saul", "last_name": "Tigh", "phone_number": "666-555-1111", "email_address": "xo@bsg.org", "notes": "Sort of a futuristic pirate"}]}

View File

@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2829" systemVersion="12A269" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="FBr-nd-hVt">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1914"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="Hf8-3P-vOM">
<objects>
<tableViewController id="FBr-nd-hVt" customClass="RKSViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="uRw-Ou-61V">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<searchBar key="tableHeaderView" contentMode="redraw" id="721-rL-xnH">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="FBr-nd-hVt" id="ZG1-tN-0NK"/>
</connections>
</searchBar>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ContactCell" textLabel="Bgy-Ld-4b3" detailTextLabel="Ted-1d-0gQ" style="IBUITableViewCellStyleValue1" id="27A-tw-Pw1">
<rect key="frame" x="0.0" y="66" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label translatesAutoresizingMaskIntoConstraints="NO" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" text="Title" adjustsFontSizeToFit="NO" autoshrinkMode="none" id="Bgy-Ld-4b3">
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
</label>
<label translatesAutoresizingMaskIntoConstraints="NO" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" text="Detail" textAlignment="right" adjustsFontSizeToFit="NO" autoshrinkMode="none" id="Ted-1d-0gQ">
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.2196078431372549" green="0.32941176470588235" blue="0.52941176470588236" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="FBr-nd-hVt" id="g10-Vj-VvX"/>
<outlet property="delegate" destination="FBr-nd-hVt" id="Mic-Jn-mHF"/>
</connections>
</tableView>
<connections>
<outlet property="searchDisplayController" destination="kRp-9O-PfI" id="dhh-j8-F1F"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kHL-17-3wo" userLabel="First Responder" sceneMemberID="firstResponder"/>
<searchDisplayController id="kRp-9O-PfI">
<connections>
<outlet property="delegate" destination="FBr-nd-hVt" id="7iK-GH-N5r"/>
<outlet property="searchBar" destination="721-rL-xnH" id="70x-e9-FDU"/>
<outlet property="searchContentsController" destination="FBr-nd-hVt" id="KPQ-qB-sCx"/>
<outlet property="searchResultsDataSource" destination="FBr-nd-hVt" id="KOg-xG-bNJ"/>
<outlet property="searchResultsDelegate" destination="FBr-nd-hVt" id="qFi-Te-5aY"/>
</connections>
</searchDisplayController>
</objects>
<point key="canvasLocation" x="32" y="55"/>
</scene>
</scenes>
<classes>
<class className="RKSViewController" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/RKSViewController.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@@ -0,0 +1,18 @@
//
// main.m
// RKSearchExample
//
// Created by Blake Watters on 8/7/12.
// Copyright (c) 2012 Blake Watters. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "RKSAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([RKSAppDelegate class]));
}
}