Permalink
Browse files

Merge pull request #1021 from magicalpanda/develop

Release MagicalRecord 2.3.0
  • Loading branch information...
tonyarnold committed Jun 1, 2015
2 parents 7f5142c + 85942b4 commit b205dd5bb4e1d544c3d9d360866e4a033805c1db
Showing with 11,136 additions and 6,360 deletions.
  1. +13 −0 .clang-format
  2. +12 −0 .cocoadocs.yml
  3. +2 −0 .gitignore
  4. +3 −6 .gitmodules
  5. +7 −0 .travis.yml
  6. +18 −1 Changelog.md → CHANGELOG.md
  7. +25 −0 CONTRIBUTING.md
  8. +1 −0 Cartfile.private
  9. +1 −0 Cartfile.resolved
  10. +1 −0 Carthage/Checkouts/expecta
  11. +13 −0 Docs/Creating-Entities.md
  12. +0 −26 Docs/DefaultManagedObjectContext.md
  13. +25 −0 Docs/Deleting-Entities.md
  14. +129 −0 Docs/Fetching-Entities.md
  15. +0 −127 Docs/Fetching.md
  16. +84 −0 Docs/Getting-Started.md
  17. +0 −29 Docs/GettingStarted.md
  18. +194 −0 Docs/Importing-Data.md
  19. +0 −3 Docs/Importing.md
  20. +0 −21 Docs/Installation.md
  21. +75 −0 Docs/Installing-MagicalRecord.md
  22. +41 −3 Docs/Logging.md
  23. +2 −3 Docs/{Resources.md → Other-Resources.md}
  24. +148 −0 Docs/Saving-Entities.md
  25. +0 −44 Docs/Saving.md
  26. +0 −44 Docs/Support.md
  27. +51 −27 Docs/Threads.md
  28. +85 −0 Docs/Working-with-Managed-Object-Contexts.md
  29. +0 −14 Docs/iCloud.md
  30. +5 −1 LICENSE
  31. +13 −11 MagicalRecord.podspec
  32. +2,663 −0 MagicalRecord.xcodeproj/project.pbxproj
  33. 0 {Project Files → }/MagicalRecord.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  34. +102 −0 MagicalRecord.xcodeproj/xcshareddata/xcschemes/MagicalRecord for OS X.xcscheme
  35. +102 −0 MagicalRecord.xcodeproj/xcshareddata/xcschemes/MagicalRecord for iOS.xcscheme
  36. +84 −0 MagicalRecord.xcodeproj/xcshareddata/xcschemes/libMagicalRecord for OS X.xcscheme
  37. +84 −0 MagicalRecord.xcodeproj/xcshareddata/xcschemes/libMagicalRecord for iOS.xcscheme
  38. +9 −11 MagicalRecord/Categories/DataImport/MagicalImportFunctions.h
  39. +36 −17 MagicalRecord/Categories/DataImport/MagicalImportFunctions.m
  40. +18 −4 MagicalRecord/Categories/DataImport/NSAttributeDescription+MagicalDataImport.m
  41. +12 −0 MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.h
  42. +27 −9 MagicalRecord/Categories/DataImport/NSEntityDescription+MagicalDataImport.m
  43. +1 −0 MagicalRecord/Categories/DataImport/NSNumber+MagicalDataImport.h
  44. +1 −0 MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.h
  45. +9 −14 MagicalRecord/Categories/DataImport/NSObject+MagicalDataImport.m
  46. +1 −2 MagicalRecord/Categories/DataImport/NSRelationshipDescription+MagicalDataImport.m
  47. +1 −0 MagicalRecord/Categories/DataImport/NSString+MagicalDataImport.h
  48. +40 −4 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.h
  49. +76 −17 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalAggregation.m
  50. +13 −3 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.h
  51. +171 −109 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
  52. +19 −14 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.h
  53. +107 −33 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalFinders.m
  54. +35 −11 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.h
  55. +132 −39 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRecord.m
  56. +34 −1 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalRequests.m
  57. +35 −0 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.h
  58. +50 −0 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalChainSave.m
  59. +49 −0 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.h
  60. +12 −13 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalObserving.m
  61. +108 −9 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.h
  62. +235 −163 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalRecord.m
  63. +62 −64 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.h
  64. +111 −94 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalSaves.m
  65. +4 −2 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.h
  66. +30 −2 MagicalRecord/Categories/NSManagedObjectContext/NSManagedObjectContext+MagicalThreading.m
  67. +2 −3 MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.h
  68. +13 −3 MagicalRecord/Categories/NSManagedObjectModel+MagicalRecord.m
  69. +1 −1 MagicalRecord/Categories/NSPersistentStore+MagicalRecord.h
  70. +5 −18 MagicalRecord/Categories/NSPersistentStore+MagicalRecord.m
  71. +16 −2 MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.h
  72. +214 −60 MagicalRecord/Categories/NSPersistentStoreCoordinator+MagicalRecord.m
  73. +10 −20 MagicalRecord/Core/MagicalRecord+Actions.h
  74. +34 −26 MagicalRecord/Core/MagicalRecord+Actions.m
  75. +1 −1 MagicalRecord/Core/MagicalRecord+ErrorHandling.h
  76. +8 −7 MagicalRecord/Core/MagicalRecord+ErrorHandling.m
  77. +128 −13 MagicalRecord/Core/MagicalRecord+Options.h
  78. +28 −13 MagicalRecord/Core/MagicalRecord+Options.m
  79. +4 −1 MagicalRecord/Core/MagicalRecord+Setup.h
  80. +20 −0 MagicalRecord/Core/MagicalRecord+Setup.m
  81. +10 −0 MagicalRecord/Core/MagicalRecord+ShorthandMethods.h
  82. +135 −0 MagicalRecord/Core/MagicalRecord+ShorthandMethods.m
  83. +0 −17 MagicalRecord/Core/MagicalRecord+ShorthandSupport.h
  84. +0 −147 MagicalRecord/Core/MagicalRecord+ShorthandSupport.m
  85. +29 −5 MagicalRecord/Core/MagicalRecord+iCloud.h
  86. +29 −4 MagicalRecord/Core/MagicalRecord+iCloud.m
  87. +0 −52 MagicalRecord/Core/MagicalRecord.h
  88. +7 −0 MagicalRecord/Core/MagicalRecordDeprecationMacros.h
  89. +98 −0 MagicalRecord/Core/MagicalRecordInternal.h
  90. +14 −6 MagicalRecord/Core/{MagicalRecord.m → MagicalRecordInternal.m}
  91. +49 −0 MagicalRecord/Core/MagicalRecordLogging.h
  92. +166 −87 MagicalRecord/Core/{MagicalRecordShorthand.h → MagicalRecordShorthandMethodAliases.h}
  93. +0 −62 MagicalRecord/CoreData+MagicalRecord.h
  94. +46 −0 MagicalRecord/MagicalRecord.h
  95. BIN Project Files/Default-568h@2x.png
  96. +0 −9 Project Files/Library/Support/MagicalRecord-iOS-Prefix.pch
  97. +0 −1,432 Project Files/MagicalRecord.xcodeproj/project.pbxproj
  98. +0 −60 Project Files/Rakefile
  99. +0 −14 Project Files/Tests/Core/MagicalRecordTests.h
  100. +0 −123 Project Files/Tests/Core/MagicalRecordTests.m
  101. +0 −13 Project Files/Tests/Core/NSManagedObjectContextHelperTests.h
  102. +0 −13 Project Files/Tests/Core/NSManagedObjectHelperTests.h
  103. +0 −124 Project Files/Tests/Core/NSManagedObjectHelperTests.m
  104. +0 −13 Project Files/Tests/Core/NSManagedObjectModelHelperTests.h
  105. +0 −14 Project Files/Tests/Core/NSManagedObjectModelHelperTests.m
  106. +0 −13 Project Files/Tests/Core/NSPersisentStoreHelperTests.h
  107. +0 −109 Project Files/Tests/Core/NSPersisentStoreHelperTests.m
  108. +0 −13 Project Files/Tests/Core/NSPersistentStoreCoordinatorHelperTests.h
  109. +0 −56 Project Files/Tests/Core/NSPersistentStoreCoordinatorHelperTests.m
  110. +0 −109 Project Files/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityUsingMappedPrimaryKeyTests.m
  111. +0 −193 Project Files/Tests/DataImport/ImportSingleEntityWithNoRelationshipsTests.m
  112. +0 −96 Project Files/Tests/DataImport/ImportSingleRelatedEntityTests.m
  113. +0 −21 Project Files/Tests/DataImport/MagicalDataImportTestCase.h
  114. +0 −45 Project Files/Tests/DataImport/MagicalDataImportTestCase.m
  115. +0 −5 Project Files/Tests/Fixtures/Mac/TestModel.xcdatamodeld/.xccurrentversion
  116. +0 −24 Project Files/Tests/MagicalDataImportTestCase.h.orig
  117. +0 −390 Project Files/Tests/MagicalRecord+ActionsSpec.m
  118. +0 −528 Project Files/Tests/NSManagedObjectContext+MagicalSavesSpec.m
  119. +0 −188 Project Files/Tests/SaveTests.m
  120. +0 −8 Project Files/Tests/Support/MagicalRecordTests-OSX-Prefix.pch
  121. +0 −1 Project Files/Tests/Support/Vendor/Expecta
  122. +0 −1 Project Files/Tests/Support/Vendor/Kiwi
  123. +0 −2 Project Files/Tests/Support/en.lproj/InfoPlist.strings
  124. +0 −133 Project Files/generateShorthandFile.rb
  125. +26 −0 README.md
  126. +0 −67 Samples/Mac/Mac Sample App.xcodeproj/project.pbxproj
  127. +2 −2 Samples/iOS/Application/Controllers/ImperialPickerController.m
  128. +2 −2 Samples/iOS/Application/Controllers/IngredientDetailViewController.m
  129. +6 −1 Samples/iOS/Application/Controllers/InstructionsViewController.m
  130. +2 −2 Samples/iOS/Application/Controllers/MetricPickerController.m
  131. +3 −1 Samples/iOS/Application/Controllers/RecipeAddViewController.m
  132. +14 −12 Samples/iOS/Application/Controllers/RecipeDetailViewController.m
  133. +13 −6 Samples/iOS/Application/Controllers/RecipeListTableViewController.m
  134. +4 −0 Samples/iOS/Application/Controllers/RecipePhotoViewController.m
  135. +62 −0 Samples/iOS/Application/Controllers/TemperatureCell.h
  136. +67 −0 Samples/iOS/Application/Controllers/TemperatureCell.m
  137. +5 −2 Samples/iOS/Application/Controllers/TemperatureConverterViewController.m
  138. +2 −2 Samples/iOS/Application/Controllers/TypeSelectionViewController.m
  139. +1 −1 Samples/iOS/Application/Delegate/MGPRecipesAppDelegate.h
  140. +2 −1 Samples/iOS/Application/Delegate/MGPRecipesAppDelegate.m
  141. +2 −2 Samples/iOS/Application/Models/generated/_Ingredient.m
  142. +1 −1 Samples/iOS/Application/Support/{Recipies-Info.plist → Recipes-Info.plist}
  143. +1 −1 Samples/iOS/Application/Support/{Recipies-Prefix.pch → Recipes-Prefix.pch}
  144. +1 −1 Samples/iOS/Application/Support/main.m
  145. +153 −166 Samples/iOS/Application/Views/MainWindow.xib
  146. +91 −324 Samples/iOS/Application/Views/RecipeAddView.xib
  147. +244 −270 Samples/iOS/MagicalRecordRecipes.xcodeproj/project.pbxproj
  148. +28 −0 Support/Info.plist
  149. +270 −0 Support/Scripts/GenerateShorthandAliases.rb
  150. +18 −0 Support/Scripts/objc-build-scripts/LICENSE.md
  151. +82 −0 Support/Scripts/objc-build-scripts/README.md
  152. +47 −0 Support/Scripts/objc-build-scripts/bootstrap
  153. +173 −0 Support/Scripts/objc-build-scripts/cibuild
  154. +11 −0 Support/Scripts/objc-build-scripts/schemes.awk
  155. +25 −0 Support/Scripts/objc-build-scripts/xctool.awk
  156. +258 −0 Tests/Core/MagicalRecord+ActionsTests.m
  157. +114 −0 Tests/Core/MagicalRecord+StackTests.m
  158. +13 −0 Tests/Core/MagicalRecordTestBase.h
  159. +32 −0 Tests/Core/MagicalRecordTestBase.m
  160. +31 −0 Tests/Core/NSManagedObject+MagicalRecordTests.m
  161. +56 −0 Tests/Core/NSManagedObjectContext+ChainSaveTests.m
  162. +265 −0 Tests/Core/NSManagedObjectContext+MagicalSavesTests.m
  163. +17 −17 {Project Files → }/Tests/Core/NSManagedObjectContextHelperTests.m
  164. +160 −0 Tests/Core/NSManagedObjectHelperTests.m
  165. +109 −0 Tests/Core/NSPersistentStoreCoordinatorHelperTests.m
  166. +84 −0 Tests/Core/NSPersistentStoreHelperTests.m
  167. +40 −0 Tests/DataImport/ImportMultipleEntitiesWithNoPrimaryKeyTests.m
  168. +8 −5 ...es → }/Tests/DataImport/ImportSingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKeyTests.m
  169. +22 −29 {Project Files → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityUsingDefaultsTests.m
  170. +91 −0 Tests/DataImport/ImportSingleEntityRelatedToMappedEntityUsingMappedPrimaryKeyTests.m
  171. +9 −7 ...les → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityWithNestedMappedAttributesTests.m
  172. +8 −5 ...ct Files → }/Tests/DataImport/ImportSingleEntityRelatedToMappedEntityWithSecondaryMappingsTests.m
  173. +236 −0 Tests/DataImport/ImportSingleEntityWithNoRelationshipsTests.m
  174. +108 −0 Tests/DataImport/ImportSingleRelatedEntityTests.m
  175. +19 −0 Tests/DataImport/MagicalDataImportTestCase.h
  176. +33 −0 Tests/DataImport/MagicalDataImportTestCase.m
  177. +3 −2 {Project Files → }/Tests/Fixtures/FixtureHelpers.h
  178. +10 −17 {Project Files → }/Tests/Fixtures/FixtureHelpers.m
  179. 0 ...les → }/Tests/Fixtures/ImportSingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeysTests.m
  180. +14 −0 Tests/Fixtures/MultipleEntitiesWithNoPrimaryKey.json
  181. 0 {Project Files → }/Tests/Fixtures/SampleJSONDataForImport.json
  182. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToManyMappedEntitiesUsingListOfPrimaryKeys.json
  183. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.json
  184. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityUsingDefaults.json
  185. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.json
  186. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.json
  187. 0 {Project Files → }/Tests/Fixtures/SingleEntityRelatedToMappedEntityWithSecondaryMappings.json
  188. +5 −2 {Project Files → }/Tests/Fixtures/SingleEntityWithNoRelationships.json
  189. +4 −0 {Project Files → }/Tests/Fixtures/SingleEntityWithNoRelationships.plist
  190. +7 −7 {Project Files → }/Tests/Fixtures/SingleRelatedEntity.json
  191. +82 −111 ... Files/Tests/Fixtures/Mac → Tests/Fixtures}/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents
  192. +5 −0 Tests/Fixtures/TestModel/AbstractRelatedEntity.h
  193. +13 −0 Tests/Fixtures/TestModel/AbstractRelatedEntity.m
  194. +5 −0 Tests/Fixtures/TestModel/ConcreteRelatedEntity.h
  195. +13 −0 Tests/Fixtures/TestModel/ConcreteRelatedEntity.m
  196. +5 −0 Tests/Fixtures/TestModel/DifferentClassNameMapping.h
  197. +13 −0 Tests/Fixtures/TestModel/DifferentClassNameMapping.m
  198. +10 −0 Tests/Fixtures/TestModel/EntityWithoutEntityNameMethod.h
  199. +10 −0 Tests/Fixtures/TestModel/EntityWithoutEntityNameMethod.m
  200. +5 −0 Tests/Fixtures/TestModel/MappedEntity.h
  201. +13 −0 Tests/Fixtures/TestModel/MappedEntity.m
  202. +5 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.h
  203. +13 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.m
  204. +5 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingDefaults.h
  205. +13 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingDefaults.m
  206. +5 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.h
  207. +13 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.m
  208. +5 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.h
  209. +13 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.m
  210. +5 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithSecondaryMappings.h
  211. +13 −0 Tests/Fixtures/TestModel/SingleEntityRelatedToMappedEntityWithSecondaryMappings.m
  212. +5 −0 Tests/Fixtures/TestModel/SingleEntityWithNoRelationships.h
  213. +13 −0 Tests/Fixtures/TestModel/SingleEntityWithNoRelationships.m
  214. +5 −0 Tests/Fixtures/TestModel/SingleRelatedEntity.h
  215. +13 −0 Tests/Fixtures/TestModel/SingleRelatedEntity.m
  216. +30 −0 Tests/Fixtures/TestModel/_AbstractRelatedEntity.h
  217. +36 −0 Tests/Fixtures/TestModel/_AbstractRelatedEntity.m
  218. +31 −0 Tests/Fixtures/TestModel/_ConcreteRelatedEntity.h
  219. +36 −0 Tests/Fixtures/TestModel/_ConcreteRelatedEntity.m
  220. +19 −0 Tests/Fixtures/TestModel/_DifferentClassNameMapping.h
  221. +30 −0 Tests/Fixtures/TestModel/_DifferentClassNameMapping.m
  222. +58 −0 Tests/Fixtures/TestModel/_MappedEntity.h
  223. +49 −0 Tests/Fixtures/TestModel/_MappedEntity.m
  224. +54 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.h
  225. +55 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToManyMappedEntitiesUsingMappedPrimaryKey.m
  226. +43 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingDefaults.h
  227. +42 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingDefaults.m
  228. +32 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.h
  229. +36 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityUsingMappedPrimaryKey.m
  230. +32 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.h
  231. +36 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithNestedMappedAttributes.m
  232. +51 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithSecondaryMappings.h
  233. +59 −0 Tests/Fixtures/TestModel/_SingleEntityRelatedToMappedEntityWithSecondaryMappings.m
  234. +181 −0 Tests/Fixtures/TestModel/_SingleEntityWithNoRelationships.h
  235. +87 −0 Tests/Fixtures/TestModel/_SingleEntityWithNoRelationships.m
  236. +84 −0 Tests/Fixtures/TestModel/_SingleRelatedEntity.h
  237. +69 −0 Tests/Fixtures/TestModel/_SingleRelatedEntity.m
  238. +10 −0 Tests/Support/MagicalRecordTestHelpers.h
  239. +23 −0 Tests/Support/MagicalRecordTestHelpers.m
  240. 0 {Project Files → }/Tests/Support/MagicalRecordTests-OSX-Info.plist
  241. +1 −0 ...es/Library/Support/MagicalRecord-OSX-Prefix.pch → Tests/Support/MagicalRecordTests-OSX-Prefix.pch
  242. 0 {Project Files → }/Tests/Support/MagicalRecordTests-iOS-Info.plist
  243. +1 −1 {Project Files → }/Tests/Support/MagicalRecordTests-iOS-Prefix.pch
  244. +49 −0 circle.yml
View
@@ -0,0 +1,13 @@
+BasedOnStyle: Chromium
+AlignTrailingComments: true
+BreakBeforeBraces: Allman
+ColumnLimit: 0
+IndentWidth: 4
+KeepEmptyLinesAtTheStartOfBlocks: false
+ObjCBlockIndentWidth: 4
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PointerBindsToType: false
+SpacesBeforeTrailingComments: 1
+TabWidth: 8
+UseTab: Never
View
@@ -0,0 +1,12 @@
+additional_guides:
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Installing-MagicalRecord
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Getting-Started
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Working-with-Managed-Object-Contexts
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Creating-Entities
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Deleting-Entities
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Fetching-Entities
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Saving
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Usage-Patterns
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Importing-Data
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Logging
+ - https://github.com/magicalpanda/MagicalRecord/wiki/Upgrading-to-MagicalRecord-2.3
View
@@ -17,3 +17,5 @@ xcuserdata
profile
*.moved-aside
+DerivedData
+Carthage/Build
View
@@ -1,6 +1,3 @@
-[submodule "Project Files/Tests/Support/Vendor/Kiwi"]
- path = Project Files/Tests/Support/Vendor/Kiwi
- url = git://github.com/allending/Kiwi.git
-[submodule "Project Files/Tests/Support/Vendor/Expecta"]
- path = Project Files/Tests/Support/Vendor/Expecta
- url = git@github.com:petejkim/expecta.git
+[submodule "Carthage/Checkouts/expecta"]
+ path = Carthage/Checkouts/expecta
+ url = https://github.com/specta/expecta.git
View
@@ -0,0 +1,7 @@
+language: objective-c
+script: Support/Scripts/objc-build-scripts/cibuild
+before_install:
+ - brew update
+ - if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
+
+osx_image: xcode61
@@ -1,5 +1,22 @@
# Changelog
+## Version 2.3
+* Dynamic framework targets are provided for both OS X 10.8+ and iOS 8.0+
+* Logging is enabled by default, change the logging level using `+[MagicalRecord setLoggingLevel: MagicalRecordLogLevelOff];` — [see the documentation in the wiki](https://github.com/magicalpanda/MagicalRecord/wiki/Logging)
+* CocoaLumberjack 2.0 support
+* Enabling shorthand category method names can now be done by importing:
+
+ ```objective-c
+ #import <MagicalRecord/MagicalRecord.h>
+ #import <MagicalRecord/MagicalRecord+ShorthandMethods.h>
+ #import <MagicalRecord/MagicalRecordShorthandMethodAliases.h>
+ ```
+ Then calling `+[MagicalRecord enableShorthandMethods]`.
+ [See the documentation in the wiki](https://github.com/magicalpanda/MagicalRecord/wiki/Installing-MagicalRecord#shorthand-category-methods).
+
+* Support for running with Core Data's concurrency debugging checks enabled
+* Many, many, many, many fixes to reported issues
+
## Version 2.2
* Updated examples and fixed errors in README - [Tony Arnold](mailto:tony@thecocoabots.com)
* Changes block saves to use child context of rootSavingContext so that large saves do not channel through the default context and block the main thread - r-peck
@@ -51,7 +68,7 @@
* Added fetchAllWithDelegate: method for NSFRC `c0a1657` - [Saul Mora](mailto:saul@magicalpanda.com)
* Fixed Issue #294 - MR_requestAllSortedBy:ascending:inContext: did not use correct context `3656e74` - [Stephen Vanterpool](mailto:stephen@vanterpool.net)
* Bumping podspec version `fb81b5b` - [Stephen Vanterpool](mailto:stephen@vanterpool.net)
->>>>>>> release/2.1.0
+
## Version 2.0.7
* Fix small error in README with regard to MR_SHORTHAND - [Maik Gosenshuis](mailto:maik@gosenshuis.nl)
* Hide intended private cleanUpErrorHandling method - [Saul Mora](mailto:saul@magicalpanda.com)
View
@@ -0,0 +1,25 @@
+Thanks for contributing to this project!
+
+To make the process as easy as possible, we've got a few guidelines that we'd appreciate you following:
+
+## Filing Issues
+
+Before you file an issue, please ensure that:
+
+1. **It's a bug or a feature request** — if you're looking for help using MagicalRecord, please ask your question on [Stack Overflow](http://stackoverflow.com/). We monitor the [**MagicalRecord** tag](http://stackoverflow.com/questions/tagged/magicalrecord) so be sure to tag your question so that we see it
+1. **Search for an existing issue** — there's a good chance you're not the only one experiencing the problem you've come to tell us about
+2. **Include as much information as you can** — if we can't reproduce the problem you've filed, we can't fix it. Include crash logs, exception reports and code if you can.
+
+## We Prefer Pull Requests
+
+If you know exactly how to implement the feature being suggested or fix the bug being reported, please open a pull request instead of an issue. Pull requests are easier than patches or inline code blocks for discussing and merging the changes. Please ensure that you include tests in the Pull Request — we use XCTest with [Expecta](http://github.com/specta/expecta/).
+
+If you can't make the change yourself, please open an issue after making sure that one isn't already logged.
+
+## Contributing Code
+
+Fork this repository, make some great changes (preferably in a branch named for the topic of the changes you're making) and send a pull request!
+
+All code contributions should match our [coding conventions](/magicalpanda/MagicalRecord/wiki/Coding-Conventions).
+
+Thanks for reading the guidelines!
View
@@ -0,0 +1 @@
+github "specta/expecta" ~> 1.0
View
@@ -0,0 +1 @@
+github "specta/expecta" "v1.0.1"
Submodule expecta added at 9a4e64
View
@@ -0,0 +1,13 @@
+# Creating Entities
+
+To create and insert a new instance of an Entity in the default context, you can use:
+
+```objective-c
+Person *myPerson = [Person MR_createEntity];
+```
+
+To create and insert an entity into specific context:
+
+```objective-c
+Person *myPerson = [Person MR_createEntityInContext:otherContext];
+```
@@ -1,26 +0,0 @@
-
-
-### Default Managed Object Context
-
-When using Core Data, you will deal with two types of objects the most: *NSManagedObject* and *NSManagedObjectContext*. MagicalRecord provides a single place for a default NSManagedObjectContext for use within your app. This is great for single threaded apps. You can easily get to this default context by calling:
-
- [NSManagedObjectContext MR_defaultContext];
-
-This context will be used if a find or request method (described below) does not specify a specific context using the **inContext:** method overload.
-
-If you need to create a new Managed Object Context for use in other threads, based on the default persistent store that was creating using one of the setup methods, use:
-
- NSManagedObjectContext *myNewContext = [NSManagedObjectContext MR_context];
-
-This will use the same object model and persistent store, but create an entirely new context for use with threads other than the main thread.
-
-And, if you want to make *myNewContext* the default for all fetch requests on the main thread:
-
- [NSManagedObjectContext MR_setDefaultContext:myNewContext];
-
-MagicalRecord also has a helper method to hold on to a Managed Object Context in a thread's threadDictionary. This lets you access the correct NSManagedObjectContext instance no matter which thread you're calling from. This methods is:
-
- [NSManagedObjectContext MR_contextForCurrentThread];
-
-**It is *highly* recommended that the default context is created and set using the main thread**
-
View
@@ -0,0 +1,25 @@
+# Deleting Entities
+
+To delete a single entity in the default context:
+
+```objective-c
+[myPerson MR_deleteEntity];
+```
+
+To delete the entity from a specific context:
+
+```objective-c
+[myPerson MR_deleteEntityInContext:otherContext];
+```
+
+To truncate all entities from the default context:
+
+```objective-c
+[Person MR_truncateAll];
+```
+
+To truncate all entities in a specific context:
+
+```objective-c
+[Person MR_truncateAllInContext:otherContext];
+```
View
@@ -0,0 +1,129 @@
+# Fetching Entities
+
+#### Basic Finding
+
+Most methods in MagicalRecord return an `NSArray` of results.
+
+As an example, if you have an entity named *Person* related to a *Department* entity (as seen in many of [Apple's Core Data examples](.com/library/mac/documentation/Cocoa/Conceptual/CoreData/Articles/cdBasics.html#//apple_ref/doc/uid/TP40001650-TP1)), you can retrieve all of the *Person* entities from your persistent store using the following method:
+
+```objective-c
+NSArray *people = [Person MR_findAll];
+```
+
+To return the same entities sorted by a specific attribute:
+
+```objective-c
+NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName"
+ ascending:YES];
+```
+
+To return the entities sorted by multiple attributes:
+
+```objective-c
+NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName"
+ ascending:YES];
+```
+
+To return the results sorted by multiple attributes with different values. If you don't provide a value for any attribute, it will default to whatever you've set in your model:
+
+```objective-c
+NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName:NO,FirstName"
+ ascending:YES];
+
+// OR
+
+NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName:YES"
+ ascending:NO];
+```
+
+If you have a unique way of retrieving a single object from your data store (such as an identifier attribute), you can use the following method:
+
+```objective-c
+Person *person = [Person MR_findFirstByAttribute:@"FirstName"
+ withValue:@"Forrest"];
+```
+
+#### Advanced Finding
+
+If you want to be more specific with your search, you can use a predicate:
+
+```objective-c
+NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", @[dept1, dept2]];
+NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
+```
+
+#### Returning an NSFetchRequest
+
+```objective-c
+NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];
+NSFetchRequest *people = [Person MR_requestAllWithPredicate:peopleFilter];
+```
+
+For each of these single line calls, an `NSFetchRequest` and `NSSortDescriptor`s for any sorting criteria are created.
+
+#### Customizing the Request
+
+```objective-c
+NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];
+
+NSFetchRequest *peopleRequest = [Person MR_requestAllWithPredicate:peopleFilter];
+[peopleRequest setReturnsDistinctResults:NO];
+[peopleRequest setReturnPropertiesNamed:@[@"FirstName", @"LastName"]];
+
+NSArray *people = [Person MR_executeFetchRequest:peopleRequest];
+```
+
+#### Find the number of entities
+
+You can also perform a count of all entities of a specific type in your persistent store:
+
+```objective-c
+NSNumber *count = [Person MR_numberOfEntities];
+```
+
+Or, if you're looking for a count of entities based on a predicate or some filter:
+
+```objective-c
+NSNumber *count = [Person MR_numberOfEntitiesWithPredicate:...];
+```
+
+There are also complementary methods which return `NSUInteger` rather than `NSNumber` instances:
+
+```objective-c
++ (NSUInteger) MR_countOfEntities;
++ (NSUInteger) MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context;
++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter;
++ (NSUInteger) MR_countOfEntitiesWithPredicate:(NSPredicate *)searchFilter
+ inContext:(NSManagedObjectContext *)context;
+```
+
+#### Aggregate Operations
+
+```objective-c
+NSNumber *totalCalories = [CTFoodDiaryEntry MR_aggregateOperation:@"sum:"
+ onAttribute:@"calories"
+ withPredicate:predicate];
+
+NSNumber *mostCalories = [CTFoodDiaryEntry MR_aggregateOperation:@"max:"
+ onAttribute:@"calories"
+ withPredicate:predicate];
+
+NSArray *caloriesByMonth = [CTFoodDiaryEntry MR_aggregateOperation:@"sum:"
+ onAttribute:@"calories"
+ withPredicate:predicate
+ groupBy:@"month"];
+```
+
+#### Finding entities in a specific context
+
+All find, fetch, and request methods have an `inContext:` method parameter that allows you to specify which managed object context you'd like to query:
+
+```objective-c
+NSArray *peopleFromAnotherContext = [Person MR_findAllInContext:someOtherContext];
+
+Person *personFromContext = [Person MR_findFirstByAttribute:@"lastName"
+ withValue:@"Gump"
+ inContext:someOtherContext];
+
+NSUInteger count = [Person MR_numberOfEntitiesWithContext:someOtherContext];
+```
Oops, something went wrong.

0 comments on commit b205dd5

Please sign in to comment.