Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Realm使ってみた (SWWDC 仙台iPhoneとか開発者勉強会 その26)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
tototti
February 02, 2016
Programming
470
0
Share
Realm使ってみた (SWWDC 仙台iPhoneとか開発者勉強会 その26)
2016/01/30 SWWDC 仙台iPhoneとか開発者勉強会 その26 - 新春ライトニングトーク大会 -
tototti
February 02, 2016
More Decks by tototti
See All by tototti
ShazamKit調べてみた - 仙台iOS開発者勉強会 SWWDC47 - AppleEvent振り返り + LT会
tototti
0
240
2017年 SWWDCの活動振り返りと来年の展望
tototti
0
700
CoreMLやってみた - 2017/07/15 AKIBA.Swift x SWWDC
tototti
0
1.2k
データサイエンスで宝くじ hack
tototti
0
1.4k
Xcodeの小ネタ (SWWDC 仙台iPhoneとか開発者勉強会 その26)
tototti
0
430
Other Decks in Programming
See All in Programming
New "Type" system on PicoRuby
pocke
1
430
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.1k
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
160
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
340
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
3.1k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
260
今さら聞けないCancellationToken
htkym
0
210
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
240
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
110
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
310
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
The SEO Collaboration Effect
kristinabergwall1
1
470
A Modern Web Designer's Workflow
chriscoyier
698
190k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
The Pragmatic Product Professional
lauravandoore
37
7.3k
Building an army of robots
kneath
306
46k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Agile that works and the tools we love
rasmusluckow
331
21k
A better future with KSS
kneath
240
18k
Transcript
3FBMNͬͯΈͨ 488%$ !UPUPUUJ
ಡΈํϨϧϜ
3FBMN w NPCJMF͚ͷσʔλϕʔε w 42-JUFͷସΛࢦ͍ͯ͠ΔΒ͍͠ w 3FMBUJPOBMͰͳ͘ɺ,74Β͍͠ ˞ Ͳ͔ͬʹॻ͍͚ͯ͋ͬͨͲɺ ະ֬ೝ
ɾТɾA
ͬͯΈͨ w ʮઋϏʔϧϚοϓʯΞϓϦ w ళฮνΣοΫΠϯػೳ
Πϯετʔϧ w QPEl3FBMN w QPEJOTUBMM
ςʔϒϧఆٛ w ΫϥεΛॻ͚ͩ͘ͰPL @interface Visit : RLMObject @property NSString* shopID;
@property NSDate* visitDate; @property NSString* memo; @property NSData* imageData; @end 4XJGU0CK$ࠞࡏϓϩδΣΫτͷ߹ɺ 0CK$Ͱॻ͘΄͏͕ྑ͍Β͍͠ ŖAшŖ /4%BUF /4%BUB ͦͷ··Ϳͬ͜ΊΔ
JOTFSUEFMFUF RLMRealm *realm = [RLMRealm defaultRealm]; [realm beginWriteTransaction]; [realm addObject:visit];
[realm commitWriteTransaction]; RLMRealm *realm = [RLMRealm defaultRealm]; [realm beginWriteTransaction]; [realm deleteObject:visit]; [realm commitWriteTransaction];
VQEBUF w ࠓճΘͳ͔͕ͬͨʜ w ςʔϒϧʹϓϥΠϚϦΩʔΛࢦఆ͢Δ // addOrUpdateObjectͰupdate realm.beginWriteTransaction() realm.addOrUpdateObject(visit) realm.commitWriteTransaction()
4FMFDU // શऔಘ RLMResults<Visit *> *visits = [Visit allObjects]; //
શऔಘ + ιʔτ NSArray* sortProperties = @[[RLMSortDescriptor sortDescriptorWithProperty:@"visitDate" ascending:NO]]; RLMResults<Visit *> *visits = [[Visit allObjects] sortedResultsUsingDescriptors:sortProperties]; // ݅ࢦఆ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"shopID = %@", shopID]; RLMResults<Visit *> *visits = [Visit objectsWithPredicate:predicate];
͜Εշదʜ
·ͱΊ w ͍Β͍͠ w ͱʹָ͔͘ɻ w ςʔϒϧ࡞ w JOTFSUEFMFUFTFMFDU w
খ͍͞σʔλͰɺQMJTUอଘ͢ΔΑΓָ