RBQChangeNotificationBlock Block Reference
| Declared in | RLMObject+Notifications.h |
|---|
Repository: Roobiq/RBQFetchedResultsController Branch: master Commit: 75612dc62756 Files: 155 Total size: 816.5 KB Directory structure: gitextract_mfzjlkfi/ ├── .gitignore ├── .gitmodules ├── .swift-version ├── CHANGELOG.md ├── Cartfile ├── Documentation/ │ └── html/ │ ├── Blocks/ │ │ ├── RBQChangeNotificationBlock.html │ │ └── RBQNotificationBlock.html │ ├── Categories/ │ │ ├── RLMArray+Utilities.html │ │ ├── RLMObject+Notifications.html │ │ ├── RLMObject+SafeObject.html │ │ ├── RLMObject+Utilities.html │ │ └── RLMRealm+Notifications.html │ ├── Classes/ │ │ ├── RBQEntityChangesObject.html │ │ ├── RBQFetchRequest.html │ │ ├── RBQFetchedResultsController.html │ │ ├── RBQFetchedResultsSectionInfo.html │ │ ├── RBQRealmChangeLogger.html │ │ ├── RBQRealmNotificationManager.html │ │ └── RBQSafeRealmObject.html │ ├── Protocols/ │ │ └── RBQFetchedResultsControllerDelegate.html │ ├── css/ │ │ ├── scss/ │ │ │ ├── _index.scss │ │ │ ├── _layout.scss │ │ │ ├── _normalize.scss │ │ │ ├── _object.scss │ │ │ ├── _print.scss │ │ │ ├── _variables.scss │ │ │ ├── _xcode.scss │ │ │ └── style.scss │ │ ├── style.css │ │ ├── styles.css │ │ └── stylesPrint.css │ ├── hierarchy.html │ ├── index.html │ └── js/ │ └── script.js ├── Examples/ │ ├── ObjC/ │ │ ├── Podfile │ │ ├── RBQFetchedResultsControllerExample/ │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── ExampleTableViewController.h │ │ │ ├── ExampleTableViewController.m │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── TestObject.h │ │ │ ├── TestObject.m │ │ │ └── main.m │ │ ├── RBQFetchedResultsControllerExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── RBQFetchedResultsControllerExampleTests/ │ │ ├── Info.plist │ │ ├── RBQFetchRequestInMemoryTests.m │ │ ├── RBQFetchRequestTests.m │ │ ├── RBQFetchedResultsControllerDelegateTests.m │ │ ├── RBQFetchedResultsControllerTests.m │ │ ├── RBQFetchedResultsControllerWithSectionsDelegateTests.m │ │ ├── RBQFetchedResultsSectionInfoTests.m │ │ ├── RBQSafeRealmObjectTests.m │ │ ├── RBQTestCase.h │ │ └── RBQTestCase.m │ ├── ObjC-carthage/ │ │ ├── RBQFetchedResultsControllerExample/ │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── ExampleTableViewController.h │ │ │ ├── ExampleTableViewController.m │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── TestObject.h │ │ │ ├── TestObject.m │ │ │ └── main.m │ │ ├── RBQFetchedResultsControllerExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── RBQFetchedResultsControllerExampleTests/ │ │ └── Info.plist │ ├── ObjC-cocoapods/ │ │ ├── Podfile │ │ ├── RBQFetchedResultsControllerExample/ │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── ExampleTableViewController.h │ │ │ ├── ExampleTableViewController.m │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── TestObject.h │ │ │ ├── TestObject.m │ │ │ └── main.m │ │ ├── RBQFetchedResultsControllerExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── RBQFetchedResultsControllerExampleTests/ │ │ ├── Info.plist │ │ ├── RBQEntityChangesObjectTests.m │ │ ├── RBQFetchRequestInMemoryTests.m │ │ ├── RBQFetchRequestTests.m │ │ ├── RBQFetchedResultsControllerDelegateTests.m │ │ ├── RBQFetchedResultsControllerTests.m │ │ ├── RBQFetchedResultsSectionInfoTests.m │ │ ├── RBQRealmChangeLoggerTests.m │ │ ├── RBQSafeRealmObjectTests.m │ │ ├── RBQTestCase.h │ │ └── RBQTestCase.m │ ├── Swift/ │ │ ├── .swift-version │ │ ├── Podfile │ │ ├── RBQFRCSwiftExample/ │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ ├── MainTableViewController.swift │ │ │ └── RBQFRCSwift-BridgingHeader.h │ │ ├── RBQFRCSwiftExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── RBQFRCSwiftExampleTests/ │ │ ├── Info.plist │ │ └── RBQFRCSwiftExampleTests.swift │ ├── Swift-carthage/ │ │ ├── RBQFRCSwiftExample/ │ │ │ ├── AppDelegate.swift │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.xib │ │ │ │ └── Main.storyboard │ │ │ ├── Images.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ └── MainTableViewController.swift │ │ ├── RBQFRCSwiftExample.xcodeproj/ │ │ │ └── project.pbxproj │ │ └── RBQFRCSwiftExampleTests/ │ │ ├── Info.plist │ │ └── RBQFRCSwiftExampleTests.swift │ └── Swift-cocoapods/ │ ├── .swift-version │ ├── Podfile │ ├── RBQFRCSwiftExample/ │ │ ├── AppDelegate.swift │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── Images.xcassets/ │ │ │ └── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── MainTableViewController.swift │ │ └── RBQFRCSwift-BridgingHeader.h │ ├── RBQFRCSwiftExample.xcodeproj/ │ │ └── project.pbxproj │ └── RBQFRCSwiftExampleTests/ │ ├── Info.plist │ └── RBQFRCSwiftExampleTests.swift ├── LICENSE ├── RBQFetchedResultsController/ │ ├── Info.plist │ ├── ModuleMapFile │ ├── RBQFRC.h │ ├── RBQFetchedResultsControllerTests/ │ │ └── Info.plist │ └── Source/ │ ├── CacheObjects/ │ │ ├── RBQControllerCacheObject.h │ │ ├── RBQControllerCacheObject.m │ │ ├── RBQObjectCacheObject.h │ │ ├── RBQObjectCacheObject.m │ │ ├── RBQSectionCacheObject.h │ │ └── RBQSectionCacheObject.m │ ├── RBQFetchRequest.h │ ├── RBQFetchRequest.m │ ├── RBQFetchedResultsController.h │ ├── RBQFetchedResultsController.m │ └── Swift/ │ ├── FetchRequest.swift │ ├── FetchedResultsController.swift │ ├── Info.plist │ ├── RBQFRCSwift-BridgingHeader.h │ ├── SwiftFetchedResultsController.h │ └── Utilities.swift ├── RBQFetchedResultsController.podspec ├── RBQFetchedResultsController.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ └── contents.xcworkspacedata │ └── xcshareddata/ │ └── xcschemes/ │ ├── RBQFetchedResultsController.xcscheme │ └── SwiftFetchedResultsController.xcscheme ├── README.md └── SwiftFetchedResultsController.podspec ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # macOS .DS_Store # Xcode build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.moved-aside DerivedData *.hmap *.ipa *.resolved *.xcuserstate xcuserdata *.xccheckout *.xcscmblueprint # Only ignore example workspaces Examples/**/*.xcworkspace # Carthage Carthage/ # CocoaPods Podfile.lock Pods/ ================================================ FILE: .gitmodules ================================================ ================================================ FILE: .swift-version ================================================ 3.0.1 ================================================ FILE: CHANGELOG.md ================================================ ## master * Add your own contribution below ## 5.0.0 * Swift 3 - Ben Chatelain #103 ## 4.0.4 ================================================ FILE: Cartfile ================================================ github "realm/realm-cocoa" github "Roobiq/RealmUtilities" github "Roobiq/RBQSafeRealmObject" ================================================ FILE: Documentation/html/Blocks/RBQChangeNotificationBlock.html ================================================
| Declared in | RLMObject+Notifications.h |
|---|
| Declared in | RBQRealmNotificationManager.h |
|---|
| Declared in | RLMArray+Utilities.h |
|---|
– containsObject:
Detect if RLMArray contains a given RLMObject
- (BOOL)containsObject:(RLMObject *)anObjectanObject |
RLMObject |
|---|
YES if RLMArray contains given object
Detect if RLMArray contains a given RLMObject
RLMArray+Utilities.h
| Declared in | RLMObject+Notifications.h |
|---|
Category on RLMObject that provides convenience methods to change a RLMObject while automatically notifying RBQRealmChangeLogger
– changeWithNotification:
Convenience method that accepts a RBQChangeNotificationBlock, which contains the current RLMObject as a parameter.
- (void)changeWithNotification:(RBQChangeNotificationBlock)blockblock |
Block contains the RLMObject used to call this method. Edit the RLMObject within the block. |
|---|
Convenience method that accepts a RBQChangeNotificationBlock, which contains the current RLMObject as a parameter.
Edit the parameter object in the block and an automatic notification will be generated for RBQRealmChangeLogger
RLMObject+Notifications.h
– changeWithNotificationInTransaction:
Convenience method that accepts a RBQChangeNotificationBlock, which contains the current RLMObject as a parameter.
- (void)changeWithNotificationInTransaction:(RBQChangeNotificationBlock)blockblock |
Block contains the RLMObject used to call this method. Edit the RLMObject within the block. |
|---|
Convenience method that accepts a RBQChangeNotificationBlock, which contains the current RLMObject as a parameter.
The block will be run within the required beginWriteTransaction and commitWriteTransaction calls automatically. Edit the parameter object in the block and an automatic notification will be generated for RBQRealmChangeLogger.
RLMObject+Notifications.h
| Declared in | RLMObject+SafeObject.h |
|---|
+ rbq_objectFromSafeObject:
Create a RLMObject from a RBQSafeRealmObject
+ (instancetype)rbq_objectFromSafeObject:(RBQSafeRealmObject *)safeObjectsafeObject |
RBQSafeRealmObject instance |
|---|
RLMObject of appropriate subtype
Create a RLMObject from a RBQSafeRealmObject
Returns nil if the safe object’s className doesn’t match ours.
RLMObject+SafeObject.h
+ rbq_objectInRealm:fromSafeObject:
Create a RLMObject in a specific Realm from a RBQSafeRealmObject
+ (instancetype)rbq_objectInRealm:(RLMRealm *)realm fromSafeObject:(RBQSafeRealmObject *)safeObjectrealm |
Realm in which the returned RLMObject is persisted |
|---|---|
safeObject |
RBQSafeRealmObject to convert into RLMObject |
RLMObject of appropriate subtype
Create a RLMObject in a specific Realm from a RBQSafeRealmObject
Returns nil if the safe object’s className doesn’t match ours.
RLMObject+SafeObject.h
– rbq_safeObject
Create a RBQSafeRealmObject from a RLMObject
- (RBQSafeRealmObject *)rbq_safeObjectRBQSafeRealmObject which is a thread-safe representation of the original RLMObject
Create a RBQSafeRealmObject from a RLMObject
RLMObject+SafeObject.h
| Declared in | RLMObject+Utilities.h |
|---|
This utility category provides convenience methods to retrieve the primary key and original class name for an RLMObject.
+ primaryKeyValueForObject:
Retrieve the primary key for a given RLMObject
+ (id)primaryKeyValueForObject:(RLMObject *)objectobject |
RLMObject with a primary key |
|---|
Primary key value (NSInteger or NSString only)
Retrieve the primary key for a given RLMObject
RLMObject+Utilities.h
+ classNameForObject:
Retrieve the original class name for a generic RLMObject. Realm dynamically changes the class at run-time, whereas this method returns the programatic class name.
+ (NSString *)classNameForObject:(RLMObject *)objectobject |
A RLMObject |
|---|
Original programatic class name
Retrieve the original class name for a generic RLMObject. Realm dynamically changes the class at run-time, whereas this method returns the programatic class name.
Warning: This method returns the class name to be used programatically (such as with NSClassFromString()). Class names within Swift follow the pattern: “AppName.ClassName” whereas Obj-C it is simply “ClassName”. See Apple docs for more info: http://apple.co/1HMPGjg
RLMObject+Utilities.h
| Declared in | RLMRealm+Notifications.h |
|---|
Category on RLMRealm that provides convenience methods similar to RLMRealm class methods but include notifying RBQRealmNotificationManager
– addObjectWithNotification:
Convenience method to add an object to the Realm and notify RBQRealmChangeLogger
- (void)addObjectWithNotification:(RLMObject *)objectobject |
Standalone RLMObject to be persisted |
|---|
Convenience method to add an object to the Realm and notify RBQRealmChangeLogger
RLMRealm+Notifications.h
– addObjectsWithNotification:
Convenience method to add a collection of RLMObjects to the Realm and notify RBQRealmChangeLogger
- (void)addObjectsWithNotification:(id<NSFastEnumeration>)arrayarray |
A collection object that conforms to NSFastEnumeration (e.g. NSArray, RLMArray, RLMResults) |
|---|
Convenience method to add a collection of RLMObjects to the Realm and notify RBQRealmChangeLogger
RLMRealm+Notifications.h
– addOrUpdateObjectWithNotification:
Convenience method to add or update a RLMObject to the Realm and notify RBQRealmChangeLogger
- (void)addOrUpdateObjectWithNotification:(RLMObject *)objectobject |
RLMObject to add or update in the Realm |
|---|
Convenience method to add or update a RLMObject to the Realm and notify RBQRealmChangeLogger
If the RLMObject is already persisted, then the new object will be used to update the persisted object.
RLMRealm+Notifications.h
– addOrUpdateObjectsFromArrayWithNotification:
Convenience method to add or update a collection of RLMObjects to the Realm and notify RBQRealmChangeLogger
- (void)addOrUpdateObjectsFromArrayWithNotification:(id<NSFastEnumeration>)arrayarray |
A collection object that conforms to NSFastEnumeration (e.g. NSArray, RLMArray, RLMResults) |
|---|
Convenience method to add or update a collection of RLMObjects to the Realm and notify RBQRealmChangeLogger
If any RLMObject is already persisted, then the new object will be used to update the persisted object.
RLMRealm+Notifications.h
– deleteObjectWithNotification:
Convenience method to delete a RLMObject from the Realm and notify RBQRealmChangeLogger
- (void)deleteObjectWithNotification:(RLMObject *)objectobject |
RLMObject to delete from the Realm |
|---|
Convenience method to delete a RLMObject from the Realm and notify RBQRealmChangeLogger
RLMRealm+Notifications.h
– deleteObjectsWithNotification:
Convenience method to delete a collection of RLMObjects from the Realm and notify RBQRealmChangeLogger
- (void)deleteObjectsWithNotification:(id<NSFastEnumeration>)arrayarray |
A collection object that conforms to NSFastEnumeration (e.g. NSArray, RLMArray, RLMResults) |
|---|
Convenience method to delete a collection of RLMObjects from the Realm and notify RBQRealmChangeLogger
RLMRealm+Notifications.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQRealmNotificationManager.h |
Class used by the RBQRealmNotificationManager to represent the change set for a given entity. This object is passed in the NSDictionary (keyed by the entity name) contained in the RBQNotificationBlock after a change to monitored Realm.
className
The class name of the entity
@property (readonly, nonatomic) NSString *classNameThe class name of the entity
RBQRealmNotificationManager.h
addedSafeObjects
Collection of RBQSafeRealmObjects representing the added objects
@property (readonly, nonatomic) NSSet *addedSafeObjectsCollection of RBQSafeRealmObjects representing the added objects
RBQRealmNotificationManager.h
deletedSafeObjects
Collection of RBQSafeRealmObjects representing the deleted objects
@property (readonly, nonatomic) NSSet *deletedSafeObjectsCollection of RBQSafeRealmObjects representing the deleted objects
RBQRealmNotificationManager.h
changedSafeObjects
Collection of RBQSafeRealmObjects representing the changed objects
@property (readonly, nonatomic) NSSet *changedSafeObjectsCollection of RBQSafeRealmObjects representing the changed objects
RBQRealmNotificationManager.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQFetchRequest.h |
This class is used by the RBQFetchedResultsController to represent the properties of the fetch. The RBQFetchRequest is specific to one RLMObject and uses an NSPredicate and array of RLMSortDescriptors to define the query.
entityName
RLMObject class name for the fetch request
@property (nonatomic, readonly) NSString *entityNameRLMObject class name for the fetch request
RBQFetchRequest.h
realm
The Realm in which the entity for the fetch request is persisted.
@property (nonatomic, readonly) RLMRealm *realmThe Realm in which the entity for the fetch request is persisted.
RBQFetchRequest.h
realmPath
Path for the Realm associated with the fetch request
@property (nonatomic, readonly) NSString *realmPathPath for the Realm associated with the fetch request
RBQFetchRequest.h
inMemoryRealmId
The identifier of the in-memory Realm.
@property (nonatomic, readonly) NSString *inMemoryRealmIdThe identifier of the in-memory Realm.
Warning: return nil if fetch request initialized without in-memory Realm
RBQFetchRequest.h
predicate
Predicate supported by Realm
@property (nonatomic, strong) NSPredicate *predicateRBQFetchRequest.h
sortDescriptors
Array of RLMSortDescriptors
@property (nonatomic, strong) NSArray *sortDescriptorsRBQFetchRequest.h
+ fetchRequestWithEntityName:inRealm:predicate:
Constructor method to create a fetch request for a given entity name in a specific Realm.
+ (RBQFetchRequest *)fetchRequestWithEntityName:(NSString *)entityName inRealm:(RLMRealm *)realm predicate:(NSPredicate *)predicateentityName |
Class name for the RLMObject |
|---|---|
realm |
RLMRealm in which the RLMObject is persisted (if passing in-memory Realm, make sure to keep a strong reference elsewhere since fetch request only stores the path) |
predicate |
NSPredicate that represents the search query |
A new instance of RBQFetchRequest
Constructor method to create a fetch request for a given entity name in a specific Realm.
RBQFetchRequest.h
+ fetchRequestWithEntityName:inMemoryRealm:predicate:
Constructor method to create a fetch request for a given entity name in an in-memory Realm.
+ (RBQFetchRequest *)fetchRequestWithEntityName:(NSString *)entityName inMemoryRealm:(RLMRealm *)inMemoryRealm predicate:(NSPredicate *)predicateentityName |
Class name for the RLMObject |
|---|---|
inMemoryRealm |
In-memory RLMRealm in which the RLMObject is persisted (caller must retain strong reference as fetch request does not) |
predicate |
NSPredicate that represents the search query |
A new instance of RBQFetchRequest
Constructor method to create a fetch request for a given entity name in an in-memory Realm.
RBQFetchRequest.h
– fetchObjectsInRealm:
Retrieve all the RLMObjects for this fetch request in the specified realm.
- (RLMResults *)fetchObjectsInRealm:(RLMRealm *)realmrealm |
RLMRealm in which the RLMObjects are persisted |
|---|
RLMResults for all the objects in the fetch request (not thread-safe).
Retrieve all the RLMObjects for this fetch request in the specified realm.
RBQFetchRequest.h
– evaluateObject:
Should this object be in our fetch results?
- (BOOL)evaluateObject:(RLMObject *)objectobject |
Realm object of appropriate type |
|---|
YES if performing fetch would include this object
Should this object be in our fetch results?
Intended to be used by the RBQFetchedResultsController to evaluate incremental changes. For simple fetch requests this just evaluates the NSPredicate, but subclasses may have a more complicated implementaiton.
RBQFetchRequest.h
– initWithEntityName:inRealm:
Create RBQFetchRequest in RLMRealm instance with an entity name
- (instancetype)initWithEntityName:(NSString *)entityName inRealm:(RLMRealm *)realmentityName |
Class name for the RLMObject |
|---|---|
realm |
RLMRealm in which the RLMObject is persisted |
A new instance of RBQFetchRequest
Create RBQFetchRequest in RLMRealm instance with an entity name
RBQFetchRequest.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQFetchedResultsController.h |
The class is used to monitor changes from a RBQRealmNotificationManager to convert these changes into specific index path or section index changes. Typically this is used to back a UITableView and support animations when items are inserted, deleted, or changed.
fetchRequest
The fetch request for the controller
@property (nonatomic, readonly) RBQFetchRequest *fetchRequestThe fetch request for the controller
RBQFetchedResultsController.h
sectionNameKeyPath
The section name key path used to create the sections. Can be nil if no sections.
@property (nonatomic, readonly) NSString *sectionNameKeyPathThe section name key path used to create the sections. Can be nil if no sections.
RBQFetchedResultsController.h
delegate
The delegate to pass the index path and section changes to.
@property (nonatomic, weak) id<RBQFetchedResultsControllerDelegate> delegateThe delegate to pass the index path and section changes to.
RBQFetchedResultsController.h
cacheName
The name of the cache used internally to represent the tableview structure.
@property (nonatomic, readonly) NSString *cacheNameThe name of the cache used internally to represent the tableview structure.
RBQFetchedResultsController.h
fetchedObjects
All the objects that match the fetch request.
@property (nonatomic, readonly) RLMResults *fetchedObjectsAll the objects that match the fetch request.
RBQFetchedResultsController.h
+ deleteCacheWithName:
Deletes the cached section information with the given name
+ (void)deleteCacheWithName:(NSString *)namename |
The name of the cache file to delete. If name is nil, deletes all cache files. |
|---|
Deletes the cached section information with the given name
If name is not nil, then the cache will be cleaned, but not deleted from disk.
If name is nil, then all caches will be deleted by removing the files from disk.
Warning: If clearing all caches (name is nil), it is recommended to do this in didFinishLaunchingWithOptions: in AppDelegate because RLMRealm files cannot be deleted from disk safely, if there are strong references to them.
RBQFetchedResultsController.h
+ allCacheRealmPaths
Retrieves all the paths for the Realm files being used as FRC caches on disk.
+ (NSArray *)allCacheRealmPathsNSArray of NSStrings representing the paths on disk for all FRC cache Realm files
Retrieves all the paths for the Realm files being used as FRC caches on disk.
The typical use case for this method is to use the paths to perform migrations in AppDelegate. The FRC cache files need to be migrated along with your other Realm files because by default Realm includes all of the properties defined in your model in all Realm files. Thus the FRC cache files will throw an exception if they are not migrated. Call setSchemaVersion:forRealmAtPath:withMigrationBlock: for each path returned in the array.
RBQFetchedResultsController.h
– initWithFetchRequest:sectionNameKeyPath:cacheName:
Constructor method to initialize the controller
- (id)initWithFetchRequest:(RBQFetchRequest *)fetchRequest sectionNameKeyPath:(NSString *)sectionNameKeyPath cacheName:(NSString *)namefetchRequest |
the RBQFetchRequest for the controller |
|---|---|
sectionNameKeyPath |
A key path on result objects that returns the section name. Pass nil to indicate that the controller should generate a single section. If this key path is not the same as that specified by the first sort descriptor in fetchRequest, they must generate the same relative orderings. |
name |
the cache name (if nil, cache will not be persisted and built using an in-memory Realm) |
A new instance of RBQFetchedResultsController
Constructor method to initialize the controller
Warning: Specify a cache name if deletion of the cache later on is necessary
RBQFetchedResultsController.h
– initWithFetchRequest:sectionNameKeyPath:inMemoryRealmCache:
Constructor method to initialize the controller using an explicit in-memory Realm rather than the persisted cache.
- (id)initWithFetchRequest:(RBQFetchRequest *)fetchRequest sectionNameKeyPath:(NSString *)sectionNameKeyPath inMemoryRealmCache:(RLMRealm *)inMemoryRealmfetchRequest |
the RBQFetchRequest for the controller |
|---|---|
sectionNameKeyPath |
the section name key path used to create sections (can be nil) |
inMemoryRealm |
the in-memory Realm to be used for the internal cache |
A new instance of RBQFetchedResultsController
Constructor method to initialize the controller using an explicit in-memory Realm rather than the persisted cache.
RBQFetchedResultsController.h
– performFetch
Method to tell the controller to perform the fetch
- (BOOL)performFetchIndicates if the fetch was successful
Method to tell the controller to perform the fetch
RBQFetchedResultsController.h
– reset
Call this method to force the cache to be rebuilt.
- (void)resetCall this method to force the cache to be rebuilt.
A potential use case would be to call this in a @catch after trying to call endUpdates for the table view. If an exception is thrown, then the cache will be rebuilt and you can call reloadData on the table view.
RBQFetchedResultsController.h
– numberOfRowsForSectionIndex:
Method to retrieve the number of rows for a given section index
- (NSInteger)numberOfRowsForSectionIndex:(NSInteger)indexindex |
section index |
|---|
number of rows in the section
Method to retrieve the number of rows for a given section index
RBQFetchedResultsController.h
– numberOfSections
Method to retrieve the number of sections represented by the fetch request
- (NSInteger)numberOfSectionsnumber of sections
Method to retrieve the number of sections represented by the fetch request
RBQFetchedResultsController.h
– titleForHeaderInSection:
Method to retrieve the title for a given section index
- (NSString *)titleForHeaderInSection:(NSInteger)sectionsection |
section index |
|---|
The title of the section
Method to retrieve the title for a given section index
RBQFetchedResultsController.h
– sectionIndexForSectionName:
Method to retrieve the section index given a section name
- (NSUInteger)sectionIndexForSectionName:(NSString *)sectionNamesectionName |
the name of the section |
|---|
the index of the section (returns NSNotFound if no section with the given name)
Method to retrieve the section index given a section name
Warning: Returns NSNotFound if there is not a section with the given name
RBQFetchedResultsController.h
– safeObjectAtIndexPath:
Retrieve the RBQSafeRealmObject for a given index path
- (RBQSafeRealmObject *)safeObjectAtIndexPath:(NSIndexPath *)indexPathindexPath |
the index path of the object |
|---|
Retrieve the RBQSafeRealmObject for a given index path
RBQFetchedResultsController.h
– objectAtIndexPath:
Retrieve the RLMObject for a given index path
- (id)objectAtIndexPath:(NSIndexPath *)indexPathindexPath |
the index path of the object |
|---|
RLMObject
Retrieve the RLMObject for a given index path
Warning: Returned object is not thread-safe.
RBQFetchedResultsController.h
– objectInRealm:atIndexPath:
Retrieve the RLMObject in a specific Realm for a given index path
- (id)objectInRealm:(RLMRealm *)realm atIndexPath:(NSIndexPath *)indexPathrealm |
the Realm in which the RLMObject is persisted |
|---|---|
indexPath |
the index path of the object |
RLMObject
Retrieve the RLMObject in a specific Realm for a given index path
RBQFetchedResultsController.h
– indexPathForSafeObject:
Retrieve the index path for a safe object in the fetch request
- (NSIndexPath *)indexPathForSafeObject:(RBQSafeRealmObject *)safeObjectsafeObject |
|---|
index path of the object
Retrieve the index path for a safe object in the fetch request
RBQFetchedResultsController.h
– indexPathForObject:
Retrieve the index path for a RLMObject in the fetch request
- (NSIndexPath *)indexPathForObject:(RLMObject *)objectobject |
RLMObject |
|---|
index path of the object
Retrieve the index path for a RLMObject in the fetch request
RBQFetchedResultsController.h
– updateFetchRequest:sectionNameKeyPath:andPeformFetch:
Convenience method to safely update the fetch request for an existing RBQFetchResultsController
- (void)updateFetchRequest:(RBQFetchRequest *)fetchRequest sectionNameKeyPath:(NSString *)sectionNameKeyPath andPeformFetch:(BOOL)performFetchfetchRequest |
a new instance of RBQFetchRequest |
|---|---|
sectionNameKeyPath |
the section name key path for this fetch request (if nil, no sections will be shown) |
performFetch |
indicates whether you want to immediately performFetch using the new fetch request to rebuild the cache |
Convenience method to safely update the fetch request for an existing RBQFetchResultsController
RBQFetchedResultsController.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQFetchedResultsController.h |
objects
The objects in the section (generated on-demand and not thread-safe).
@property (nonatomic, readonly) RLMResults *objectsThe objects in the section (generated on-demand and not thread-safe).
RBQFetchedResultsController.h
name
The name of the section.
@property (nonatomic, readonly) NSString *nameThe name of the section.
RBQFetchedResultsController.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQRealmNotificationManager.h |
This class is used to track changes to a given RLMRealm. Since Realm doesn’t support automatic change tracking, this class allows the developer to log object changes, which will be passed along to the RBQRealmNotificationManager who in turn broadcasts it to any listeners
Since RLMObjects are not thread-safe, when an object is logged to the manager, it is internally transformed into an RBQSafeRealmObject that is thread-safe and this will then be passed to any listeners once the Realm being monitored updates.
Warning: Only RLMObjects with primary keys can be logged because the primary key is required to create a RBQSafeRealmObject.
+ defaultLogger
Creates or retrieves the logger instance for the default Realm on the current thread
+ (instancetype)defaultLoggerInstance of RBQRealmChangeLogger
Creates or retrieves the logger instance for the default Realm on the current thread
RBQRealmNotificationManager.h
+ loggerForRealm:
Creates or retrieves the logger instance for a specific Realm on the current thread
+ (instancetype)loggerForRealm:(RLMRealm *)realmrealm |
A RLMRealm instance |
|---|
Instance of RBQRealmChangeLogger
Creates or retrieves the logger instance for a specific Realm on the current thread
RBQRealmNotificationManager.h
– didAddObject:
Register an addition for a given RLMObject
- (void)didAddObject:(RLMObject *)addedObjectaddedObject |
Added RLMObject |
|---|
Register an addition for a given RLMObject
Warning: Can be called before or after the addition to Realm
RBQRealmNotificationManager.h
– didAddObjects:
Register a collection of RLMObject additions
- (void)didAddObjects:(id<NSFastEnumeration>)addedObjectsaddedObjects |
RLMArray, RLMResults, NSSet, or NSArray of added RLMObjects |
|---|
Register a collection of RLMObject additions
Warning: Can be called before or after the additions to Realm
RBQRealmNotificationManager.h
– willDeleteObject:
Register a delete for a given RLMObject
- (void)willDeleteObject:(RLMObject *)deletedObjectdeletedObject |
To be deleted RLMObject |
|---|
Register a delete for a given RLMObject
Warning: Must be called before the delete in Realm (since the RLMObject will then be invalidated).
RBQRealmNotificationManager.h
– willDeleteObjects:
Register a collection of RLMObject deletes
- (void)willDeleteObjects:(id<NSFastEnumeration>)deletedObjectsdeletedObjects |
RLMArray, RLMResults, NSSet, or NSArray of deleted RLMObjects |
|---|
Register a collection of RLMObject deletes
Warning: Must be called before the delete in Realm (since the RLMObject will then be invalidated).
RBQRealmNotificationManager.h
– didChangeObject:
Register a change for a given RLMObject
- (void)didChangeObject:(RLMObject *)changedObjectchangedObject |
Changed RLMObject |
|---|
Register a change for a given RLMObject
Warning: Can be called before or after change to Realm
RBQRealmNotificationManager.h
– didChangeObjects:
Register a collection of RLMObject changes
- (void)didChangeObjects:(id<NSFastEnumeration>)changedObjectschangedObjects |
RLMArray, RLMResults, NSSet, or NSArray of changed RLMObjects |
|---|
Register a collection of RLMObject changes
Warning: Can be called before or after change to Realm
RBQRealmNotificationManager.h
– didAddObjects:willDeleteObjects:didChangeObjects:
Convenience method to pass array of objects changed. Will ignore nil values;
- (void)didAddObjects:(id<NSFastEnumeration>)addedObjects willDeleteObjects:(id<NSFastEnumeration>)deletedObjects didChangeObjects:(id<NSFastEnumeration>)changedObjectsaddedObjects |
RLMArray, RLMResults, NSSet, or NSArray of added RLMObjects |
|---|---|
deletedObjects |
RLMArray, RLMResults, NSSet, or NSArray of deleted RLMObjects |
changedObjects |
RLMArray, RLMResults, NSSet, or NSArray of changed RLMObjects |
Convenience method to pass array of objects changed. Will ignore nil values;
RBQRealmNotificationManager.h
| Inherits from | NSObject |
|---|---|
| Declared in | RBQRealmNotificationManager.h |
This class works in conjunction with any instances of RBQRealmChangeLogger to broadcast any changes to the registered listeners
entityChanges
Current representation of changes logged to the RBQRealmNotificationManager instance.
@property (readonly, nonatomic) NSDictionary *entityChangesCurrent representation of changes logged to the RBQRealmNotificationManager instance.
RBQRealmNotificationManager.h
+ defaultManager
Retrieve the singleton RBQRealmNotificationManager that passes changes from all Realm loggers
+ (instancetype)defaultManagerSingleton RBQRealmNotificationManager
Retrieve the singleton RBQRealmNotificationManager that passes changes from all Realm loggers
RBQRealmNotificationManager.h
– addNotificationBlock:
Use this method to add a notification block that will fire every time the Realm for this RBQNotificationManager updates. The block passes the changes from the Realm update that were logged to the RBQRealmNotificationManager.
- (RBQNotificationToken *)addNotificationBlock:(RBQNotificationBlock)blockblock |
RBQNotificationBlock that passes a NSDictionary keyed by entity name. The object for the key is a RBQEntityChangesObject which contains NSSets of all the various changes to the entity. |
|---|
A new instance of RBQNotificationToken.
Use this method to add a notification block that will fire every time the Realm for this RBQNotificationManager updates. The block passes the changes from the Realm update that were logged to the RBQRealmNotificationManager.
Warning: You must hold onto a strong reference to the returned token or it will be deallocated, preventing any changes from propogating.
RBQRealmNotificationManager.h
– removeNotification:
De-register a notification given a RBQNotificationToken.
- (void)removeNotification:(RBQNotificationToken *)tokentoken |
The RBQNotificationToken to be de-registered. |
|---|
De-register a notification given a RBQNotificationToken.
RBQRealmNotificationManager.h
| Inherits from | NSObject |
|---|---|
| Conforms to | NSCopying |
| Declared in | RBQSafeRealmObject.h |
An RBQSafeRealmObject acts as a thread-safe representation of a RLMObject.
Warning: RBQSafeRealmObjects can only be created from RLMObjects that contain a primary key. Attempting to create a RBQSafeRealmObject without a primary key will result in an exception.
className
Original RLMObject’s class name
@property (nonatomic, readonly) NSString *classNameOriginal RLMObject’s class name
RBQSafeRealmObject.h
primaryKeyValue
Original RLMObject’s primary key value
@property (nonatomic, readonly) id primaryKeyValueOriginal RLMObject’s primary key value
RBQSafeRealmObject.h
primaryKeyType
Original RLMObject’s primary key property
@property (nonatomic, readonly) RLMPropertyType primaryKeyTypeOriginal RLMObject’s primary key property
RBQSafeRealmObject.h
realm
The Realm in which this object is persisted
@property (nonatomic, readonly) RLMRealm *realmThe Realm in which this object is persisted
RBQSafeRealmObject.h
– initWithClassName:primaryKeyValue:primaryKeyType:realm:
Constructor method to create an instance of RBQSafeRealmObject
- (id)initWithClassName:(NSString *)className primaryKeyValue:(id)primaryKeyValue primaryKeyType:(RLMPropertyType)primaryKeyType realm:(RLMRealm *)realmclassName |
class name for the original RLMObject |
|---|---|
primaryKeyValue |
primary key value for the original RLMObject |
primaryKeyType |
primary key type for the original RLMObject |
realm |
Realm in which the original RLMObject is persisted |
A new instance of RBQSafeRealmObject
Constructor method to create an instance of RBQSafeRealmObject
RBQSafeRealmObject.h
+ objectInRealm:fromSafeObject:
Create a RLMObject in a specific Realm from a RBQSafeObject
+ (id)objectInRealm:(RLMRealm *)realm fromSafeObject:(RBQSafeRealmObject *)safeObjectrealm |
Realm in which the returned RLMObject is persisted |
|---|---|
safeObject |
RBQSafeRealm object to convert into RLMObject |
Converted RLMObject
Create a RLMObject in a specific Realm from a RBQSafeObject
RBQSafeRealmObject.h
– RLMObject
Quickly convert a RBQSafeRealm object into its RLMObject
- (id)RLMObjectRLMObject
Quickly convert a RBQSafeRealm object into its RLMObject
RBQSafeRealmObject.h
– isEqualToObject:
Equality test for RBQSafeObject
- (BOOL)isEqualToObject:(RBQSafeRealmObject *)objectobject |
RBQSafeRealmObject to compare |
|---|
YES if both objects contain the same primary key
Equality test for RBQSafeObject
RBQSafeRealmObject.h
| Conforms to | NSObject |
|---|---|
| Declared in | RBQFetchedResultsController.h |
– controllerWillChangeContent:
Indicates that the controller has started identifying changes.
- (void)controllerWillChangeContent:(RBQFetchedResultsController *)controllercontroller |
controller instance that noticed the change on its fetched objects |
|---|
Indicates that the controller has started identifying changes.
RBQFetchedResultsController.h
– controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:
Notifies the delegate that a fetched object has been changed due to an add, remove, move, or update. Enables RBQFetchedResultsController change tracking.
- (void)controller:(RBQFetchedResultsController *)controller didChangeObject:(RBQSafeRealmObject *)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPathcontroller |
controller instance that noticed the change on its fetched objects |
|---|---|
anObject |
changed object represented as a RBQSafeRealmObject for thread safety |
indexPath |
indexPath of changed object (nil for inserts) |
type |
indicates if the change was an insert, delete, move, or update |
newIndexPath |
the destination path for inserted or moved objects, nil otherwise |
Notifies the delegate that a fetched object has been changed due to an add, remove, move, or update. Enables RBQFetchedResultsController change tracking.
Changes are reported with the following heuristics:
On add and remove operations, only the added/removed object is reported. It’s assumed that all objects that come after the affected object are also moved, but these moves are not reported.
A move is reported when the changed attribute on the object is one of the sort descriptors used in the fetch request. An update of the object is assumed in this case, but no separate update message is sent to the delegate.
An update is reported when an object’s state changes, but the changed attributes aren’t part of the sort keys.
RBQFetchedResultsController.h
– controller:didChangeSection:atIndex:forChangeType:
The fetched results controller reports changes to its section before changes to the fetched result objects.
- (void)controller:(RBQFetchedResultsController *)controller didChangeSection:(RBQFetchedResultsSectionInfo *)section atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)typecontroller |
controller controller instance that noticed the change on its fetched objects |
|---|---|
section |
changed section represented as a RBQFetchedResultsSectionInfo object |
sectionIndex |
the section index of the changed section |
type |
indicates if the change was an insert or delete |
The fetched results controller reports changes to its section before changes to the fetched result objects.
RBQFetchedResultsController.h
– controllerDidChangeContent:
This method is called at the end of processing changes by the controller
- (void)controllerDidChangeContent:(RBQFetchedResultsController *)controllercontroller |
controller instance that noticed the change on its fetched objects |
|---|
This method is called at the end of processing changes by the controller
RBQFetchedResultsController.h