Skip to content

Instantly share code, notes, and snippets.

@jpsim
Created August 22, 2014 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpsim/6491a4206020cfb56808 to your computer and use it in GitHub Desktop.
Save jpsim/6491a4206020cfb56808 to your computer and use it in GitHub Desktop.
testStackOverflow_sahara108
- (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);
}
@jpsim
Copy link
Author

jpsim commented Aug 22, 2014

@sahara108
Copy link

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