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
//////////////////////////////////////////////////////////////////////////// | |
// | |
// Copyright 2014 Realm Inc. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// |
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]; |
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
<jazzy> | |
<Other column="12" file="/Users/jp/Projects/Alamofire/Source/Alamofire.swift" line="26"> | |
<Name>AlamofireErrorDomain</Name> | |
<USR>s:v9Alamofire20AlamofireErrorDomainSS</USR> | |
<Declaration>public let AlamofireErrorDomain: String</Declaration> | |
<Abstract> | |
<Para>Alamofire errors</Para> | |
</Abstract> | |
</Other> | |
<Other column="13" file="/Users/jp/Projects/Alamofire/Source/Alamofire.swift" line="33"> |
This file has been truncated, but you can view the full file.
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
<?xml version="1.0"?> | |
<sourcekitten> | |
<Other column="12" file="/Users/jp/realm/code/realm-cocoa/Realm/RLMArray.h" line="37"> | |
<Name>RLMArray</Name> | |
<USR>c:objc(cs)RLMArray</USR> | |
<Declaration>@interface RLMArray : NSObject <RLMCollection, NSFastEnumeration> | |
@end</Declaration> | |
<Abstract> | |
<Para>RLMArray is the container type in Realm used to define to-many relationships.</Para> | |
</Abstract> |
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
[ | |
{ | |
"key.substructure" : [ | |
{ | |
"key.namelength" : 7, | |
"key.runtime_name" : "_TtC8__main__7Ellipse", | |
"key.name" : "Ellipse", | |
"key.filepath" : "\/Users\/jp\/Projects\/SwiftGraphics\/SwiftGraphics\/Ellipse.swift", | |
"key.bodylength" : 907, | |
"key.nameoffset" : 165, |
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
select created_at | |
from [githubarchive:month.201401], | |
[githubarchive:month.201402], | |
[githubarchive:month.201403], | |
[githubarchive:month.201404], | |
[githubarchive:month.201405], | |
[githubarchive:month.201406], | |
[githubarchive:month.201407], | |
[githubarchive:month.201408], | |
[githubarchive:month.201409], |
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
/** | |
Although this example demonstrates how to store flat arrays of strings | |
on a Realm model, you can extend this pattern to store anything from | |
arrays of integers to native Swift enum's. Basically anything that you can | |
map to a representable type in Realm. | |
*/ | |
class RealmString : Object { | |
dynamic var stringValue = "" | |
} |
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
import RealmSwift | |
// Swift's syntax allows for a variety of ways to invoke closures. | |
// Here are some of them, specifically ways to making write transactions in Realm Swift. | |
// See https://realm.io/docs/swift/latest/#writes for Realm's docs on write transactions. | |
do { | |
let realm = try Realm() | |
// 1 |
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
enum MyEnum { | |
case Case1, Case2 | |
} | |
let myEnum: MyEnum? = .Case1 | |
// Implicit optional unwrapping | |
// These first two case statements fail to compile: | |
// |
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
// Example approach for modeling localized strings in Realm | |
import Foundation | |
import RealmSwift | |
enum Locale: String { | |
case English = "en" | |
case French = "fr" | |
} |