Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.0 #1304

Open
wants to merge 443 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
443 commits
Select commit Hold shift + click to select a range
ee1eb4e
Add aggregate operations that support grouping by a keypath
tonyarnold Apr 8, 2014
8f1b1a7
Update fetching documentation
tonyarnold Apr 8, 2014
eede208
Prefix import functions with MR_ to avoid conflicts
tonyarnold Apr 8, 2014
1d7635e
Removing old and busted iCloud support in favor of new and awesomer i…
casademora Apr 8, 2014
f73d3b8
Merge branch 'release/3.0' into features/3.0
tonyarnold Apr 8, 2014
e20764b
Merge pull request #713 from magicalpanda/features/3.0
tonyarnold Apr 8, 2014
f4fd596
Remove iCloud methods from shorthand file
tonyarnold Apr 8, 2014
03c1d81
Set required SDK to iOS SDK 7.0 and OS X SDK 10.9. Bump library compa…
tonyarnold Apr 8, 2014
0f99c34
Restore MR_fetchController:… method to public header
tonyarnold Apr 8, 2014
fcd3ec4
Change import from `#import "CoreData+MagicalRecord."` to `#import "M…
tonyarnold Apr 8, 2014
499300e
Add NSArray category to quickly retrieve and delete an array of manag…
tonyarnold Apr 8, 2014
72c112a
Use `+ [MagicalRecord defaultStoreName]` throughout the library
tonyarnold Apr 8, 2014
1645f18
Move logging options to the MagicalRecord+Options category
tonyarnold Apr 8, 2014
da03dc6
Add header comments for the `+[MagicalRecord logLevel]` accessor
tonyarnold Apr 8, 2014
d861127
Honour the return value from `-(BOOL)import<#AttributeName#>:` data i…
tonyarnold Apr 8, 2014
a3fe8e5
Remove unnecessary import
tonyarnold Apr 8, 2014
e367b29
Fix header imports for logging macros
tonyarnold Apr 8, 2014
b04e4e5
Remove unnecessary import
tonyarnold Apr 8, 2014
fee276b
Rename `kMagicalRecordImportUnixDate13String` to `kMagicalRecordImpor…
tonyarnold Apr 8, 2014
f08f09b
Fix the tests by updating the dateFormat to "UnixTime"
tonyarnold Jan 13, 2014
90e39e4
Initial pass at adding support for progressive migrations, based upon…
tonyarnold Apr 8, 2014
d4af937
Add method to do automatic saves when an observed context saves
tonyarnold Apr 8, 2014
390be03
Fix return type of aggregate methods — it's not guaranteed to be an N…
tonyarnold Apr 8, 2014
6922bf5
Expose minValueFor:/maxValueFor: methods that seem to have been dropp…
tonyarnold Apr 8, 2014
c96765e
Add `MR_findFirstOrCreateByAttribute:` methods to the MagicalFinders …
tonyarnold Apr 8, 2014
d4d1127
Update podspec for MR 3.0.0 (which isn't ready to go)
tonyarnold Apr 8, 2014
661ab25
Remove orphaned iCloudMagicalRecordStack implementation
tonyarnold Apr 8, 2014
4277a24
Replace `isEqualTo:` with `isEqual:`
tonyarnold Apr 8, 2014
45c1f17
Removing UIKit categories from the project for now
tonyarnold Apr 8, 2014
8d6e986
Fix broken test — it's not possible to retrieve permanent IDs for man…
tonyarnold Apr 8, 2014
d75d935
Don't ignore the error
tonyarnold Apr 8, 2014
d27cde2
Add build status to project home
tonyarnold Apr 8, 2014
2f5c3b3
Upgrade xctool before running tests
tonyarnold Apr 9, 2014
fea0f70
Print more information about the file remove error
tonyarnold Apr 9, 2014
10be38d
More detail in the error. I'm beginning to think this is TravisCI, no…
tonyarnold Apr 9, 2014
84466e6
Removing a persistent store should not return a status of NO if a fil…
tonyarnold Apr 9, 2014
c20b93b
Don't unnecessarily update xctool
tonyarnold Apr 9, 2014
5197782
Don't pollute the tests with logging
tonyarnold Apr 9, 2014
0fbea4a
Throw an exception when trying to resolve a temporary object in anoth…
tonyarnold Apr 9, 2014
b87a394
Fix return type of select and value/attribute finders
tonyarnold Apr 9, 2014
2d48087
Enable Mavericks image for testing on TravisCI
tonyarnold Apr 9, 2014
3843c6b
Latest Expecta
tonyarnold Apr 10, 2014
2823d9f
Add expected types to enumerations and other places where appropriate
tonyarnold Apr 10, 2014
eb5df4d
Update `MR_deleteInContext:` usage to `MR_deleteEntityInContext:`
tonyarnold Apr 10, 2014
ef7d11b
Git be silly
tonyarnold Apr 10, 2014
082c8e7
Git still be silly
tonyarnold Apr 10, 2014
5b3dbba
Add a contribution guide
tonyarnold Apr 10, 2014
e82c1c0
Remove an unnecessary log level check
tonyarnold Apr 10, 2014
1ef6cc7
Disable logging during tests
tonyarnold Apr 10, 2014
ffb7985
Remove requirement to defined MR_LOGGING_ENABLED before logging works.
tonyarnold Apr 10, 2014
0763bb4
Remove another instance of `MR_LOGGING_ENABLED` that I missed
tonyarnold Apr 10, 2014
14d82da
Format the save block for readability
tonyarnold Apr 10, 2014
aec6767
Replace `MR_entityName` with `MR_internalEntityName` to avoid infinit…
tonyarnold Apr 10, 2014
6b3f073
Fix Expecta submodule reference
casademora Apr 11, 2014
52df90e
Move the test scripts to a more appropriate location
tonyarnold Apr 11, 2014
a77ca78
Merge branch 'release/3.0' of github.com:magicalpanda/MagicalRecord i…
tonyarnold Apr 11, 2014
d6136fd
Latest Expecta
tonyarnold Apr 11, 2014
e0a2b8b
Fix `MR_internalEntityName` — NSManagedObject has a private method `e…
tonyarnold Apr 11, 2014
0ab2123
Replace checks for `entityName` on NSManagedObject subclasses with `n…
tonyarnold Apr 12, 2014
d649a90
Remove the shorthand entity name methods entirely
tonyarnold Apr 12, 2014
9965078
Make the `nameOfEntity` class method part of a protocol, not an inter…
tonyarnold Apr 12, 2014
92a28b9
Revert to `MR_entityName` for the time being
tonyarnold Apr 12, 2014
5b490f8
Add synchronous save methods that return a success state and optional…
tonyarnold Apr 12, 2014
7ae8db7
Don't dispatch save completion blocks to the main thread
tonyarnold Apr 12, 2014
b816e19
Save completion handlers no longer dispatch to the main thread by def…
tonyarnold Apr 12, 2014
3dad110
Entity attribute names must begin with a lowercase letter — update th…
xdream86 Apr 17, 2014
1b68f9b
Use the formal documentation warning parameter in Xcode's project set…
tonyarnold Apr 20, 2014
aa13fa0
Fix the logging so that it shows all log calls below the currently se…
tonyarnold Apr 20, 2014
6228da3
Add documentation for NSEntityDescription+MagicalDataImport.h
tonyarnold Apr 20, 2014
1023d2d
Add protocol for MOGenerator methods
tonyarnold Apr 20, 2014
3e531b4
Move NSArray+MagicalRecord to the Foundation directory
tonyarnold Apr 20, 2014
0520181
Who likes documentation? This guy!
tonyarnold Apr 20, 2014
356e09b
Rename the data import helper functions to follow Apple's function na…
tonyarnold Apr 20, 2014
72fda68
Rename category "MagicalRecord_DataImport" to "MagicalRecordDataImport"
tonyarnold Apr 20, 2014
38e658f
Latest Expecta
tonyarnold Apr 20, 2014
a003968
Fix the iOS color from string function
tonyarnold Apr 20, 2014
ac126e8
"-ObjC" is invalid unless we're building a dynamic library
tonyarnold Apr 20, 2014
fc865a3
88.4% documented
tonyarnold Apr 21, 2014
9088da3
Use modern Objective-C dictionary syntax
tonyarnold Apr 21, 2014
713b6a5
Document this!</worf>
tonyarnold Apr 21, 2014
058789b
Add a bit of documentation behind MR_awakeFromCreation
casademora Apr 23, 2014
2a5392d
Extract path creation to private standalone functions.
casademora Apr 27, 2014
fb7f31c
use MR_ prefix for copyToURL:error: method
casademora Apr 27, 2014
8824807
project updates
casademora Apr 27, 2014
d08a282
Merge branch 'release/3.0' of https://github.com/magicalpanda/Magical…
casademora Apr 27, 2014
e6fc89b
Make MOGeneratorProtocol header public for use with Mac Framework target
casademora Apr 27, 2014
a9ec615
Remove headerdoc comments that snuck into the implementation
tonyarnold Apr 25, 2014
afb4ac1
Fix NSFetchRequest example in documentation
tonyarnold Apr 27, 2014
2af80ac
Use functions to test for store locations
casademora Apr 27, 2014
426f8a0
Merge branch 'release/3.0' of https://github.com/magicalpanda/Magical…
casademora Apr 27, 2014
b4cf311
Make persistent store helper functions private
tonyarnold Apr 28, 2014
e891fd4
Be stricter in checking the logging level
tonyarnold Apr 28, 2014
768ef53
Fix logging configuration and macros
tonyarnold Apr 28, 2014
96e2c48
…and the rest of that commit *facepalm*
tonyarnold Apr 28, 2014
bcb47db
Rename MR_observeContext: method to MR_observeContexDidSave: for corr…
casademora May 7, 2014
800c6ce
Formatting!
casademora May 7, 2014
b7ff3e9
Update method signature in header to match implementation
casademora May 7, 2014
4515448
Latest Podspec changes, including a development version number
tonyarnold May 17, 2014
1c3ff4f
Reinstate the MR_LOGGING_ENABLED compile time checks for logging
tonyarnold May 17, 2014
4bef8e4
Update/Clean up Import Code
casademora May 17, 2014
3adc1d8
Rename logging enums :P
casademora May 17, 2014
6e1201e
Add option to autosave the default stack
casademora May 17, 2014
e4f898e
Cleanup code
casademora May 17, 2014
691ab4c
Use parent/child context merging for in memory store
casademora May 17, 2014
64c8449
Fixing broken tests, set merge policy on sqlite stores also
casademora May 17, 2014
2cd4211
I guess I've been writing for AppKit too much lately
casademora May 17, 2014
5d07029
Update logging documentation
tonyarnold May 18, 2014
fd959be
Formatting
tonyarnold May 18, 2014
602f11c
Update logging documentation
tonyarnold May 18, 2014
67eeeee
Move `MR_dateWithFormat:` category methods into the existing NSString…
tonyarnold May 19, 2014
ceac985
Silence unused variable warnings
tonyarnold May 19, 2014
41b7934
Resolve a type mismatch error by accepting NSPropertyDescription in p…
tonyarnold May 20, 2014
869cf7f
Silence a warning about an unused local variable which is being refer…
tonyarnold May 20, 2014
df1b15b
Add logging sub specs to the podspec.
tonyarnold May 20, 2014
00a784b
Use distinctAttribute to distinguish which attributes will be assumed…
casademora May 20, 2014
3299159
Merge branch 'release/3.0' of https://github.com/magicalpanda/Magical…
casademora May 20, 2014
26925fb
Change distinctAttribute contstant
casademora May 20, 2014
ed4f99d
Add inContext variant for `+MR_propertiesNamed:`
tonyarnold May 20, 2014
043db65
Update test data model to use `distinctAttribute` in place of `uniqui…
tonyarnold May 20, 2014
bffaf7c
Set a proper merge policy on the confinement contexts vended by the s…
casademora May 21, 2014
e2b74db
Merge pull request #1 from magicalpanda/release/3.0
fjbelchi May 25, 2014
189de3f
Added two unit tests to check the thread where the block is executed
fjbelchi May 25, 2014
7c6da35
Removed unnecessary checks
fjbelchi May 25, 2014
58f8202
Update documentation for `+ saveWithBlockAndWait:` and friends to ind…
tonyarnold May 25, 2014
ca64b94
Latest Expecta — silences Xcode upgrade warnings for at least one mor…
tonyarnold May 25, 2014
0d63ca7
Updating version information category to use an enumeration of possib…
tonyarnold May 25, 2014
312555a
Fix a mis-spelling
tonyarnold May 25, 2014
b6019f4
Removed wrong unit test
fjbelchi May 25, 2014
11fce5f
Correction in saveWithBlock documentation for sync methods
fjbelchi May 25, 2014
5c882f4
Improved description of the documentation for saveWitBlockAndWait
fjbelchi May 25, 2014
8115722
Simple helper to see if an object is temporary
casademora May 27, 2014
84e0329
Disable logging in built framework on release builds. You must manual…
casademora May 27, 2014
e5a23d8
major oops in cleaning up notification center
casademora May 27, 2014
ca1af86
Clean up code. Use primaryAttribute to look up related objects on import
casademora May 27, 2014
84a7e17
Merge branch 'release/3.0' of https://github.com/magicalpanda/Magical…
casademora May 27, 2014
7fc2119
Update how deprecations are handled, remove deprecations from shortha…
tonyarnold May 28, 2014
626671e
Fix a couple of documentation inaccuracies, and expose a notification
tonyarnold May 28, 2014
6127101
Don't use hasChanges outside of a performBlock on non-confinement typ…
tonyarnold Jun 13, 2014
e88f506
Updates to logging within the shorthand generation script
tonyarnold Jun 21, 2014
9c28176
Ensure that Foundation.framework is imported before checking `NS_BLOC…
tonyarnold Jul 3, 2014
1a6dfab
Data import to ordered relationship was fixed
Jul 7, 2014
beaa67f
Fix logging levels
tonyarnold Jul 24, 2014
54e55b6
Use a try/catch block rather than method swizzling to handle undefine…
tonyarnold Jul 28, 2014
b866eb3
modelClass is nicer than klass
tonyarnold Jul 28, 2014
e16f767
Only call the completion handler once when a context has no changes
tonyarnold Jul 31, 2014
0b00b70
Fix date formating
casademora Aug 6, 2014
f98761a
Latest Expecta
tonyarnold Oct 4, 2014
e738663
Initial work toward an iOS 8 framework
tonyarnold Oct 4, 2014
a2686d3
Framework targets now define modules
tonyarnold Oct 4, 2014
ae3efac
The iOS framework tests needs to copy the framework into its own bundle
tonyarnold Oct 4, 2014
e92ad09
Fix travis build scripts
tonyarnold Oct 4, 2014
818f64e
Ignore Test and Expecta schemes when compiling using TravisCI
tonyarnold Oct 4, 2014
c8b0387
Code signing is required for iOS unit test bundles
tonyarnold Oct 5, 2014
74246cc
Make MagicalRecordInternal.h public
tonyarnold Oct 31, 2014
51113b3
Do the weak/strong dance so that the weak reference to self isn't unp…
tonyarnold Oct 31, 2014
58833d8
Silence warnings about the entityName method not being implemented by…
tonyarnold Oct 31, 2014
e5e912d
Rejig the advanced save options so that they're nicer to use under Sw…
tonyarnold Oct 31, 2014
9cb195c
Xcode 6.1 upgrade checks
tonyarnold Oct 31, 2014
9043b2a
Resolve more warnings around ambiguous method resolution
tonyarnold Oct 31, 2014
adc9678
Add workaround for Travis builds failing — see https://github.com/tra…
tonyarnold Oct 31, 2014
b1d7fb4
Check for NSMigrationError alongside NSPersistentStoreIncompatibleVer…
tonyarnold Nov 1, 2014
b57d7ab
Look up the entity name from the default managed object model if it's…
tonyarnold Nov 25, 2014
d091b7b
Build CI using Xcode 6.1
tonyarnold Nov 25, 2014
c2644fc
Properly set NDEBUG
tonyarnold Nov 27, 2014
256d963
Revert "Look up the entity name from the default managed object model…
tonyarnold Nov 27, 2014
709a846
Fix for #923
Dec 10, 2014
97a4370
Added default store options for auto migrating stack #923
Dec 10, 2014
7a4dc1c
Replace MagicalRecordVersionNumber with MagicalRecordVersionTag to av…
tonyarnold Dec 28, 2014
40da6cd
Additional imports to better support CocoaPods new framework support
tonyarnold Jan 24, 2015
7887eae
Fix the location of the "Support" directory
tonyarnold Jan 24, 2015
3ee7af2
Actually test whether the child context has changes, as documented
tonyarnold Jan 29, 2015
924455a
Re-attach test targets to their schemes
tonyarnold Jan 29, 2015
a8dd474
Merge pull request #924 from sbhklr/release/3.0
tonyarnold Feb 19, 2015
e22651c
Merge pull request #777 from fjbelchi/MR3_BackgroundSaveUnitTests
tonyarnold May 26, 2015
fa3040b
Fix deprecated API use
tonyarnold Jun 13, 2015
a4298d5
Update TravisCI config to use Xcode 6.4
tonyarnold Jul 8, 2015
e4d5597
Fixed bug in attribute lookupKey resolution
casademora Aug 10, 2015
6771106
spelling
Coeur Aug 16, 2015
86929af
using MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE
Coeur Aug 17, 2015
c85ab16
Merge pull request #1061 from Coeur/release/3.0
tonyarnold Aug 17, 2015
2f67487
-- Transferred fix for Swift class name resolution from 2.0 to 3.0
csotiriou Aug 18, 2015
4b00cf0
Merge pull request #1064 from csotiriou/release/3.0
tonyarnold Aug 18, 2015
e170323
Removing MOGenerator protocol from NSManagedObject for MOGenerator+Sw…
Sep 2, 2015
b0e21d1
explicitly marking APIs _Nullable and _Notnull for swift capatibility
Sep 4, 2015
55fb02e
Fix Umbrella header warnings
Sep 4, 2015
d360521
Use Xcode 6 compatible nullability annotations
florianbuerger Sep 7, 2015
9eb59b9
Merge pull request #1079 from florianbuerger/release/3.0
tonyarnold Sep 7, 2015
295b4e8
More nullability support
casademora Sep 8, 2015
79052a4
fix unused variable static analysis warning
casademora Sep 8, 2015
83cb1db
Fix nullable markers for MagicalRecordStack actions
casademora Sep 8, 2015
d60e1e6
userinfo is a dictionary: `objectForKey:` is faster and will prevent …
Coeur Sep 15, 2015
859690c
Fix build warnings in Xcode7.0
casademora Oct 1, 2015
eafb9d4
Ignore Carthage build folder
casademora Oct 1, 2015
457f613
resolve remaining build warning
casademora Oct 1, 2015
42440f1
Add more Swift compatability with explicit nullable markers
casademora Oct 1, 2015
3e4977e
Merge pull request #1086 from Coeur/release/3.0
tonyarnold Oct 21, 2015
bedf4f4
the relatedByAttribute key in the relationship userinfo was being ign…
Nov 12, 2015
d850325
Replace manual Expecta submodule with a Carthage-managed version
tonyarnold Nov 6, 2015
cc09f1c
Move build scripts to a less specific subdirectory
tonyarnold Nov 6, 2015
6c6ea5c
Add an updated Clang format configuration
tonyarnold Nov 6, 2015
9ebc222
Add an updated Git ignore configuration
tonyarnold Nov 6, 2015
07c7ac1
Add Expecta to .gitmodules
tonyarnold Nov 6, 2015
2148072
Import xcconfigs submodule into project
tonyarnold Nov 6, 2015
adbd922
Bump copyright year
tonyarnold Nov 17, 2015
8daf9c7
Bump version in plist to 3.0
tonyarnold Nov 17, 2015
e0fee9b
Fixed MagicalRecord.framework for iOS so that it uses the correct tes…
tonyarnold Nov 17, 2015
c00f964
Clean project settings
tonyarnold Nov 17, 2015
a82f3ab
Cast to NSJSONReadingOptions to silence a warning
tonyarnold Nov 17, 2015
60b6c5b
Import appropriate header containing fetchedResultsControllerCacheName
tonyarnold Nov 17, 2015
6d396bc
Fix a couple of tests
tonyarnold Nov 17, 2015
86c5f0c
Update README for 3.0
tonyarnold Nov 17, 2015
666d8b8
Change over to Travis for build results
tonyarnold Nov 17, 2015
6a6f0bb
Reformat project source code using clang format rules in repository
tonyarnold Nov 17, 2015
2ef8658
Warn about unused parameters and variables
tonyarnold Nov 17, 2015
71b5ca4
Remove unused method variant
tonyarnold Nov 17, 2015
429a4c1
Use fast enumeration for loops — they're faster, and we weren't using…
tonyarnold Nov 17, 2015
b4152d7
Use the passed context parameter
tonyarnold Nov 17, 2015
a7091ae
Mark more parameters as explicitly unused
tonyarnold Nov 17, 2015
3c8172b
Warn when ownership of out parameters isn't explicit
tonyarnold Nov 17, 2015
3c5f238
Enable much stricter warnings, and turn on warnings as errors
tonyarnold Nov 17, 2015
ffbe551
Use module imports in the prefix headers
tonyarnold Nov 17, 2015
a878461
Use standard XCTest, remove precompiled headers
tonyarnold Nov 17, 2015
79fb4d4
Don't include tests for the static library target
tonyarnold Nov 17, 2015
6d1157b
Remove reference to deleted file
tonyarnold Nov 17, 2015
d1bf31b
Test targets require OS X 10.10 or later
tonyarnold Nov 17, 2015
9daf45e
Remove gitmodules file - we have no dependencies now!
tonyarnold Nov 18, 2015
9e4727c
Merge pull request #1135 from magicalpanda/feature/3.0-stricter-builds
tonyarnold Nov 19, 2015
964e923
Re-enable -Wnullable-to-nonnull-conversion
tonyarnold Nov 19, 2015
c2eb566
Add nullability annotations and resolve any implicit null to nonnull …
tonyarnold Nov 19, 2015
3bfb4fa
Merge pull request #1138 from magicalpanda/fix/implicit-nullability-c…
tonyarnold Nov 19, 2015
5394342
Revert to using #import rather than @import so CocoaPods doesn't chuc…
tonyarnold Nov 21, 2015
121e6b9
relative link leads to 404→ absolute link is 200:)
AmitaiB Aug 28, 2015
6c36c3a
Use new Xcode 7 generated NSManagedObject subclasses
tonyarnold Nov 22, 2015
36e5de0
Use bundle identifier, not bundle name for default persistent store f…
tonyarnold Dec 3, 2015
d1b2d5d
Enable code coverage and concurrency debugging by default
tonyarnold Dec 4, 2015
5a1a567
Add __nullable attribute on groupingKeyPath
pronebird Dec 25, 2015
f69f3a7
Merge pull request #1157 from pronebird/patch-1
tonyarnold Dec 26, 2015
4a2c9b5
ignore carthage and vendor folders
casademora Dec 14, 2015
6c2ac62
Update assertion to allow subclass entities to import
casademora Jan 3, 2016
f3dc859
Merge pull request #799 from maximmalygin/release/3.0
tonyarnold Jan 21, 2016
b23ddfb
Merge pull request #1129 from dwa012/dwa012-patch-4
tonyarnold Jan 21, 2016
5d94123
SilenceUnusedVariableWarnings
dpopov Feb 4, 2016
8eee0b0
Repositioning & GCC -> clang
dpopov Feb 9, 2016
ece159f
minorFormatting realignment
dpopov Feb 9, 2016
82b82b9
Tell TravisCI to use Xcode 7.2
tonyarnold Feb 9, 2016
b1e621c
Merge pull request #1187 from dpopov/release/3.0
tonyarnold Feb 9, 2016
14a5935
solving warnings for building with Xcode 9
Coeur Nov 26, 2017
ab0ca1c
annotation improvement over previous commit
Coeur Jun 1, 2019
e813f00
https://quuxplusone.github.io/blog/2018/12/06/dont-use-weverything/
Coeur Jun 1, 2019
f8f54b1
NS_ROOT_CLASS isn't quite compatible with Swift (partial revert of 14…
Coeur Jun 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
BasedOnStyle: Chromium
AlignTrailingComments: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBraces: Allman
ColumnLimit: 0
IndentCaseLabels: true
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: true
Standard: Auto
TabWidth: 4
UseTab: Never
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ xcuserdata
profile
*.moved-aside

DerivedData
Carthage/Build

*.gcno
*.gcda
Carthage
Vendor
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: objective-c
osx_image: xcode7.2
script: Support/Scripts/objc-build-scripts/cibuild
75 changes: 75 additions & 0 deletions Changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,80 @@
# Changelog

## Version 3.0

MagicalRecord 3.0 is a major release with new features and breaking changes.

### Stacks

MagicalRecord 3.0 introduces the concept of a 'Stack'. Applications can have a single stack, or many stacks. Library style applications like iPhoto or iTunes might only use a single stack, whereas a document-based application like TextEdit would usually use a stack for every open document.

It's easiest to think about a stack as all of the components necessary to interact with a single persistent store.

A stack includes the following basic objects:

```objc
@property (nonatomic, copy) NSString *stackName;

@property (nonatomic, strong) NSManagedObjectContext *context;
@property (nonatomic, strong) NSManagedObjectModel *model;
@property (nonatomic, strong) NSPersistentStoreCoordinator *coordinator;
@property (nonatomic, strong) NSPersistentStore *store;
```

To migrate a simple, existing MagicalRecord-based application to use stacks, it's as simple as replacing this:

```objc
[MagicalRecord setupAutoMigratingCoreDataStack];
```

with:

```objc
[MagicalRecordStack setDefaultStack:[AutoMigratingMagicalRecordStack stack]];
```

We recommend that you keep a reference to your stack somewhere other than the `defaultStack` property of the MagicalRecordStack class, so that if you need to add more than one stack it's an easier upgrade path. Also, Saul gets a bit crazy when people use singletons.

There are 9 stacks included by default:

#### SQLite Backed Stacks

All of the stacks below use SQLite-backed persistent stores (NSSQLiteStoreType).

1. **AutoMigratingMagicalRecordStack** will automatically perform all migrations provided by your project.

2. **AutoMigratingWithSourceAndTargetModelMagicalRecordStack** allows you define source and target managed object models to migrate directly between. It will not perform any additional migrations beyond those necessary to upgrade from the source model to the target.

3. **SQLiteMagicalRecordStack** provides a context that uses main queue concurrency.

4. **SQLiteWithSavingContextMagicalRecordStack** in addition to the main queue context, this stack provides a second, private background context that can be used to save changes without blocking the main thread.

3. **ClassicSQLiteMagicalRecordStack** provides a context that uses confinement concurrency when saving.

4. **ClassicWithBackgroundCoordinatorSQLiteMagicalRecordStack** in addition to the main queue context, provides a second, private background context that can be used to save changes without blocking the main thread.

4. **ManuallyMigratingMagicalRecordStack** does not automatically infer the mapping models to be used when performing migrations (`NSInferMappingModelAutomaticallyOption : NO` ).

#### iCloud Stack

**iCloudMagicalRecordStack** provides a SQLite-backed persistent store that configures a Ubiquity Container for iCloud.

#### In-Memory Stack

**InMemoryMagicalRecordStack** provides an in-memory persistent store. In-memory stacks are great for running import processes, or for use in your tests.


## Deprecations

* `MR_SHORTHAND` is deprecated in this release. You can continue using the shorthand methods, however clang will show a warning. If you absolutely must silence the deprecation warning, define `WE_PROMISE_TO_MIGRATE_TO_MAGICALRECORD_3_0` before you import any MagicalRecord header. Any method marked as deprecated in this release will be removed entirely in MagicalRecord 4.0, so please use these warnings to migrate your code to the non-shorthand methods.
* The **NSManagedObjectContext+MagicalThreading category has been removed entirely**. These methods are unnecessary alongside GCD, NSOperation and the `-performBlock:` and `-performBlockAndWait:` methods on NSManagedObjectContext. This includes the following methods:
- `+ (NSManagedObjectContext *) MR_contextForCurrentThread;`
- `+ (void) MR_clearNonMainThreadContextsCache;`
- `+ (void) MR_resetContextForCurrentThread;`
- `+ (void) MR_clearContextForCurrentThread;`



## 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
Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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](https://github.com/magicalpanda/MagicalRecord/wiki/Coding-Conventions).

Thanks for reading the guidelines!
151 changes: 84 additions & 67 deletions Docs/Fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,132 +2,149 @@

#### Basic Finding

Most methods in MagicalRecord return an NSArray of results. So, if you have an Entity called Person, related to a Department (as seen in various Apple Core Data documentation), to get all the Person entities from your Persistent Store:
Most methods in MagicalRecord return an `NSArray` of results.

//In order for this to work you need to add "#define MR_SHORTHAND" to your PCH file
NSArray *people = [Person findAll];
Say you have an Entity called "Person", related to a Department (as seen in various Apple Core Data documentation). To get all of the Person entities from your Persistent Store, use the following method:

// Otherwise you can use the longer, namespaced version
NSArray *people = [Person MR_findAll];
```objective-c
NSArray *people = [Person MR_findAll];
```

Or, to have the results sorted by a property:
Or, to return the results sorted by a property:

NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName" ascending:YES];
```objective-c
NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName" ascending:YES];
```

Or, to have the results sorted by multiple properties:
Or, to return the results sorted by multiple properties:

NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName" ascending:YES];
```objective-c
NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName" ascending:YES];
```

Or, to have the results sorted by multiple properties with difference attributes - will default to whatever you set it to:
Or, to return the results sorted by multiple properties with different attributes (these will default to whatever you set them to):

NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName:NO,FirstName" ascending:YES];
```objective-c
NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName:NO,FirstName" ascending:YES];

NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName:YES" ascending:NO];
// OR

If you have a unique way of retrieving a single object from your data store, you can get that object directly:
NSArray *peopleSorted = [Person MR_findAllSortedBy:@"LastName,FirstName:YES" ascending:NO];
```

Person *person = [Person MR_findFirstByAttribute:@"FirstName" withValue:@"Forrest"];
If you have a unique way of retrieving a single object from your data store (such as via an identifier), 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 send in a predicate:

NSArray *departments = [NSArray arrayWithObjects:dept1, dept2, ..., nil];
NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];

NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
```objective-c
NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", @[dept1, dept2]];
NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
```

#### Returning an NSFetchRequest

NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];

NSArray *people = [Person MR_findAllWithPredicate:peopleFilter];
```objective-c
NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];
NSFetchRequest *people = [Person MR_requestAllWithPredicate:peopleFilter];
```

For each of these single line calls, the full stack of NSFetchRequest, NSSortDescriptors and a simple default error handling scheme (ie. logging to the console) is created.

#### Customizing the Request

NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];
```objective-c
NSPredicate *peopleFilter = [NSPredicate predicateWithFormat:@"Department IN %@", departments];

NSFetchRequest *peopleRequest = [Person MR_requestAllWithPredicate:peopleFilter];
[peopleRequest setReturnsDistinctResults:NO];
[peopleRequest setReturnPropertiesNamed:[NSArray arrayWithObjects:@"FirstName", @"LastName", nil]];
...
NSFetchRequest *peopleRequest = [Person MR_requestAllWithPredicate:peopleFilter];
[peopleRequest setReturnsDistinctResults:NO];
[peopleRequest setReturnPropertiesNamed:@[@"FirstName", @"LastName"]];

NSArray *people = [Person MR_executeFetchRequest:peopleRequest];
NSArray *people = [Person MR_executeFetchRequest:peopleRequest];
```

#### Find the number of entities

You can also perform a count of entities in your Store, that will be performed on the Store
You can also perform a count of all entities of a specific type in your Persistent Store:

NSNumber *count = [Person MR_numberOfEntities];
```objective-c
NSNumber *count = [Person MR_numberOfEntities];
```

Or, if you're looking for a count of entities based on a predicate or some filter:

NSNumber *count = [Person MR_numberOfEntitiesWithPredicate:...];
There are also counterpart methods which return NSUInteger rather than NSNumbers:
```objective-c
NSNumber *count = [Person MR_numberOfEntitiesWithPredicate:...];
```

* countOfEntities
* countOfEntitiesWithContext:(NSManagedObjectContext *)
* countOfEntitiesWithPredicate:(NSPredicate *)
* countOfEntitiesWithPredicate:(NSPredicate *) inContext:(NSManagedObjectContext *)
There are also complementary methods which return `NSUInteger` rather than `NSNumber` instances:

* `MR_countOfEntities`
* `MR_countOfEntitiesWithContext:(NSManagedObjectContext *)context`
* `MR_countOfEntitiesWithPredicate:(NSPredicate *)predicate`
* `MR_countOfEntitiesWithPredicate:(NSPredicate *)predicatecontext inContext:(NSManagedObjectContext *)`

#### Aggregate Operations

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"diaryEntry.date == %@", today];
int totalFat = [[CTFoodDiaryEntry MR_aggregateOperation:@"sum:" onAttribute:@"fatColories" withPredicate:predicate] intValue];
int fattest = [[CTFoodDiaryEntry MR_aggregateOperation:@"max:" onAttribute:@"fatColories" withPredicate:predicate] intValue];

```objective-c
NSInteger totalFat = [[CTFoodDiaryEntry MR_aggregateOperation:@"sum:" onAttribute:@"fatCalories" withPredicate:predicate] integerValue];
NSInteger fattest = [[CTFoodDiaryEntry MR_aggregateOperation:@"max:" onAttribute:@"fatCalories" withPredicate:predicate] integerValue];
NSArray *caloriesByMonth = [CTFoodDiaryEntry MR_aggregateOperation:@"sum:" onAttribute:@"fatCalories" withPredicate:predicate groupBy:@"month"];
```

#### Finding from a different context

All find, fetch, and request methods have an inContext: method parameter

NSManagedObjectContext *someOtherContext = ...;

NSArray *peopleFromAnotherContext = [Person MR_findAllInContext:someOtherContext];
```objective-c
NSArray *peopleFromAnotherContext = [Person MR_findAllInContext:someOtherContext];

...

Person *personFromContext = [Person MR_findFirstByAttribute:@"lastName" withValue:@"Gump" inContext:someOtherContext];

...

NSUInteger count = [Person MR_numberOfEntitiesWithContext:someOtherContext];
Person *personFromContext = [Person MR_findFirstByAttribute:@"lastName" withValue:@"Gump" inContext:someOtherContext];

NSUInteger count = [Person MR_numberOfEntitiesWithContext:someOtherContext];
```

## Creating new Entities

When you need to create a new instance of an Entity, use:

Person *myNewPersonInstance = [Person MR_createEntity];
```objective-c
Person *myPerson = [Person MR_createEntity];
```

or, to specify a context:

NSManagedObjectContext *otherContext = ...;

Person *myPerson = [Person MR_createInContext:otherContext];
or, to specify which context the entity is inserted into:

```objective-c
Person *myPerson = [Person MR_createEntityInContext:otherContext];
```

## Deleting Entities

To delete a single entity:

Person *p = ...;
[p MR_deleteEntity];

or, to specify a context:
```objective-c
[myPerson MR_deleteEntity];
```

NSManagedObjectContext *otherContext = ...;
Person *deleteMe = ...;
or, to delete the entity from a specific context:

[deleteMe MR_deleteInContext:otherContext];
```objective-c
[myPerson MR_deleteEntityInContext:otherContext];
```

There is no delete *All Entities* or *truncate* operation in core data, so one is provided for you with Active Record for Core Data:

[Person MR_truncateAll];
```objective-c
[Person MR_truncateAll];
```

or, with a specific context:
or, to truncate all entities in a specific context:

NSManagedObjectContext *otherContext = ...;
[Person MR_truncateAllInContext:otherContext];
```objective-c
[Person MR_truncateAllInContext:otherContext];
```
2 changes: 1 addition & 1 deletion Docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Setting up the Core Data Stack

To get started, first, import the header file *CoreData+MagicalRecord.h* in your project's pch file. This will allow a global include of all the required headers.
To get started, first, import the header file *MagicalRecord.h* in your project's pch file. This will allow a global include of all the required headers.
Next, somewhere in your app delegate, in either the applicationDidFinishLaunching:(UIApplication \*) withOptions:(NSDictionary \*) method, or awakeFromNib, use **one** of the following setup calls with the **MagicalRecord** class:

+ (void) setupCoreDataStack;
Expand Down
Loading