Brings back previously defined NSManagedObject.fetchRequest() as .rst_fetchRequest()
This commit is contained in:
parent
279092ccc0
commit
a8ca3ef547
@ -44,7 +44,7 @@ class GameCollectionViewDataSource: NSObject
|
|||||||
{
|
{
|
||||||
let previousDelegate = self.fetchedResultsController.delegate
|
let previousDelegate = self.fetchedResultsController.delegate
|
||||||
|
|
||||||
let fetchRequest = Game.fetchRequest()
|
let fetchRequest = Game.rst_fetchRequest()
|
||||||
|
|
||||||
var predicates: [Predicate] = []
|
var predicates: [Predicate] = []
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,12 @@ extension NSManagedObject
|
|||||||
|
|
||||||
// MARK: - Fetches -
|
// MARK: - Fetches -
|
||||||
|
|
||||||
|
class func rst_fetchRequest() -> NSFetchRequest<NSFetchRequestResult>
|
||||||
|
{
|
||||||
|
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: self.entityName)
|
||||||
|
return fetchRequest
|
||||||
|
}
|
||||||
|
|
||||||
class func instancesInManagedObjectContext<T: NSManagedObject>(_ managedObjectContext: NSManagedObjectContext, type: T.Type) -> [T]
|
class func instancesInManagedObjectContext<T: NSManagedObject>(_ managedObjectContext: NSManagedObjectContext, type: T.Type) -> [T]
|
||||||
{
|
{
|
||||||
return self.instancesWithPredicate(nil, inManagedObjectContext: managedObjectContext, type: type)
|
return self.instancesWithPredicate(nil, inManagedObjectContext: managedObjectContext, type: type)
|
||||||
@ -35,7 +41,7 @@ extension NSManagedObject
|
|||||||
|
|
||||||
class func instancesWithPredicate<T: NSManagedObject>(_ predicate: Predicate?, inManagedObjectContext managedObjectContext: NSManagedObjectContext, type: T.Type) -> [T]
|
class func instancesWithPredicate<T: NSManagedObject>(_ predicate: Predicate?, inManagedObjectContext managedObjectContext: NSManagedObjectContext, type: T.Type) -> [T]
|
||||||
{
|
{
|
||||||
let fetchRequest = self.fetchRequest()
|
let fetchRequest = self.rst_fetchRequest()
|
||||||
fetchRequest.predicate = predicate
|
fetchRequest.predicate = predicate
|
||||||
|
|
||||||
var results: [T] = []
|
var results: [T] = []
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class GamesViewController: UIViewController
|
|||||||
|
|
||||||
required init?(coder aDecoder: NSCoder)
|
required init?(coder aDecoder: NSCoder)
|
||||||
{
|
{
|
||||||
let fetchRequest = GameCollection.fetchRequest()
|
let fetchRequest = GameCollection.rst_fetchRequest()
|
||||||
fetchRequest.sortDescriptors = [SortDescriptor(key: GameCollection.Attributes.index.rawValue, ascending: true)]
|
fetchRequest.sortDescriptors = [SortDescriptor(key: GameCollection.Attributes.index.rawValue, ascending: true)]
|
||||||
|
|
||||||
self.fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.sharedManager.managedObjectContext, sectionNameKeyPath: nil, cacheName: nil)
|
self.fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.sharedManager.managedObjectContext, sectionNameKeyPath: nil, cacheName: nil)
|
||||||
|
|||||||
@ -85,7 +85,7 @@ private extension CheatsViewController
|
|||||||
{
|
{
|
||||||
let game = self.delegate.cheatsViewControllerActiveEmulatorCore(self).game as! Game
|
let game = self.delegate.cheatsViewControllerActiveEmulatorCore(self).game as! Game
|
||||||
|
|
||||||
let fetchRequest = Cheat.fetchRequest()
|
let fetchRequest = Cheat.rst_fetchRequest()
|
||||||
fetchRequest.returnsObjectsAsFaults = false
|
fetchRequest.returnsObjectsAsFaults = false
|
||||||
fetchRequest.predicate = Predicate(format: "%K == %@", Cheat.Attributes.game.rawValue, game)
|
fetchRequest.predicate = Predicate(format: "%K == %@", Cheat.Attributes.game.rawValue, game)
|
||||||
fetchRequest.sortDescriptors = [SortDescriptor(key: Cheat.Attributes.name.rawValue, ascending: true)]
|
fetchRequest.sortDescriptors = [SortDescriptor(key: Cheat.Attributes.name.rawValue, ascending: true)]
|
||||||
|
|||||||
@ -147,7 +147,7 @@ private extension SaveStatesViewController
|
|||||||
{
|
{
|
||||||
let game = self.delegate.saveStatesViewControllerActiveEmulatorCore(self).game as! Game
|
let game = self.delegate.saveStatesViewControllerActiveEmulatorCore(self).game as! Game
|
||||||
|
|
||||||
let fetchRequest = SaveState.fetchRequest()
|
let fetchRequest = SaveState.rst_fetchRequest()
|
||||||
fetchRequest.returnsObjectsAsFaults = false
|
fetchRequest.returnsObjectsAsFaults = false
|
||||||
fetchRequest.predicate = Predicate(format: "%K == %@", SaveState.Attributes.game.rawValue, game)
|
fetchRequest.predicate = Predicate(format: "%K == %@", SaveState.Attributes.game.rawValue, game)
|
||||||
fetchRequest.sortDescriptors = [SortDescriptor(key: SaveState.Attributes.type.rawValue, ascending: true), SortDescriptor(key: SaveState.Attributes.creationDate.rawValue, ascending: true)]
|
fetchRequest.sortDescriptors = [SortDescriptor(key: SaveState.Attributes.type.rawValue, ascending: true), SortDescriptor(key: SaveState.Attributes.creationDate.rawValue, ascending: true)]
|
||||||
|
|||||||
4
Pods/Pods.xcodeproj/project.pbxproj
generated
4
Pods/Pods.xcodeproj/project.pbxproj
generated
@ -234,9 +234,13 @@
|
|||||||
LastUpgradeCheck = 0700;
|
LastUpgradeCheck = 0700;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
0A60B5C71D5A2CFF92811AA9AEC27278 = {
|
0A60B5C71D5A2CFF92811AA9AEC27278 = {
|
||||||
|
DevelopmentTeam = 6XVY5G3U44;
|
||||||
|
DevelopmentTeamName = "Yvette Testut";
|
||||||
LastSwiftMigration = 0800;
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
B20CFA992EEA3E3A903F2359B05A88E1 = {
|
B20CFA992EEA3E3A903F2359B05A88E1 = {
|
||||||
|
DevelopmentTeam = 6XVY5G3U44;
|
||||||
|
DevelopmentTeamName = "Yvette Testut";
|
||||||
LastSwiftMigration = 0800;
|
LastSwiftMigration = 0800;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user