Skip to content

Commit e0cb664

Browse files
committed
[README] Remove deprecated KFAttribute/KFObjectManager
1 parent 034a49b commit e0cb664

1 file changed

Lines changed: 3 additions & 54 deletions

File tree

README.md

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -33,61 +33,10 @@ KFDataStore *dataStore = [KFDataStore standardCloudDataStore];
3333
}];
3434
```
3535
36-
### KFAttribute
36+
### KFAttribute and KFObjectManager
3737
38-
Writing predicates and sort descriptors can often become cumbersome and hard
39-
to manage. Since you need a string of the key value path of any attribute you
40-
are trying to use. If you change the name or remove the attribute you will not
41-
get compile time checks that "name" was removed from the Person entity.
42-
43-
To solve this problem KFData has created a class to deal with this. You can use
44-
it as follows:
45-
46-
``` objective-c
47-
NSPredicate *kylePredicate = [[Person name] equal:@"Kyle"];
48-
// This will create a predicate which would be `"name == 'Kyle'"`.
49-
```
50-
51-
You can even use the attribute in predicate formats:
52-
53-
``` objective-c
54-
[NSPredicate predicateWithFormat:@"%K == %@", [Person name], @"Kyle"];
55-
```
56-
57-
Your managed objects wont automatically implement these methods. So you will
58-
either need to manually add them to a subclass, or alternatively you can use
59-
our Python tool to generate your managed object implementation files.
60-
Instructions on the Python tool can be found
61-
[here](https://github.com/kylef/KFData.py), this tool is still in active
62-
development so it may not be ready just yet.
63-
64-
There is another alternative, you won't get autocompletion or 100% correct
65-
compile time checks. However we provide a macro which can provide some checks
66-
providing you have the "Strict selector matching" warning enabled. This is with
67-
a macro, which can be used as follows:
68-
69-
```objective-c
70-
NSPredicate *predicate = [KFAttributeFromKey(name) equal:@"Kyle"];
71-
```
72-
73-
### KFObjectManager
74-
75-
KFData also provides a helper class to create fetch requests and perform
76-
various methods.
77-
78-
For example, to iterate over all people with an age greater than 21 you can do
79-
the following:
80-
81-
``` objective-c
82-
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K > 21", [Person age]];
83-
KFObjectManager *manager = [[Person managedInManagedObjectContext:context] filter:predicate];
84-
85-
NSLog(@"All people over 21:");
86-
87-
for (Person *person in manager) {
88-
NSLog(@"- %@", person);
89-
}
90-
```
38+
KFData used to provide two classes KFAttribute and KFObjectManager which are
39+
now superseded by [QueryKit](https://github.com/QueryKit/QueryKit).
9140
9241
## Installation
9342

0 commit comments

Comments
 (0)