Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) removeObjects_at_TopoNr_from_LocationRLM :(NSUInteger)TopoNr :(NSString *)folderName :(NSString *)fileName {
- RLMRealm *realm = [RLMRealm realmWithPath:[self get_TopoResultRLM_FilePath :folderName :fileName]];
- RLMResults *resultTopoResult = [RLMTopoResult allObjectsInRealm:realm];
- NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TopoNrRLM == %d", TopoNr];
- RLMResults *resultsTopoNr = [resultTopoResult objectsWithPredicate:predicate];
- if ([resultsTopoNr count] > 0) {
- if (TopoNr <= (int)[resultsTopoNr count]) {
- [realm beginWriteTransaction];
- [realm deleteObject:[resultsTopoNr firstObject]];
- [realm commitWriteTransaction];
- }
- else {
- NSLog(@"Fail...trying to remove TopoResult-object with TopoNr bigger to object-count");
- }
- }
- else {
- NSLog(@"Fail...trying to remove TopoResult-object in empty Realm");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement