Created
August 22, 2014 17:14
-
-
Save jpsim/6491a4206020cfb56808 to your computer and use it in GitHub Desktop.
testStackOverflow_sahara108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testStackOverflow_sahara108 | |
{ | |
[[RLMRealm defaultRealm] transactionWithBlock:^{ | |
[StringObject createInDefaultRealmWithObject:@[@"a"]]; | |
}]; | |
Class cl = [StringObject class]; | |
NSString *key = @"stringCol"; | |
NSString *value = @"a"; | |
NSPredicate *pred = [NSPredicate predicateWithFormat:@"%K = %@", key, value]; | |
RLMArray *list = [cl objectsWithPredicate:pred]; | |
XCTAssertEqualObjects([(StringObject *)list.firstObject stringCol], value); | |
} |
My realm don't have a table for class cl
. Can I ask you how to check if a table exists in Realm or I must use [cl allObjects].count > 0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Written to try to resolve http://stackoverflow.com/questions/25421731/querying-in-realm-with-predicate-crash-if-there-is-no-table