{"id":88735,"date":"2015-03-03T18:37:03","date_gmt":"2015-03-03T09:37:03","guid":{"rendered":"http:\/\/www.key-p.com\/blog\/staff\/?p=88735"},"modified":"2015-03-03T18:37:03","modified_gmt":"2015-03-03T09:37:03","slug":"realm%e4%ba%8b%e5%a7%8b%e3%82%81","status":"publish","type":"post","link":"https:\/\/www.key-p.com\/blog\/staff\/archives\/88735","title":{"rendered":"Realm\u4e8b\u59cb\u3081"},"content":{"rendered":"<p>\n\u4eca\u56de\u306fRealm\u306b\u3064\u3044\u3066\u306e\u3054\u7d39\u4ecb\u3067\u3059\u3002<br \/>\nRealm\u3068\u3044\u3046\u306e\u306f\u3001\u7c21\u5358\u306b\u8a00\u3046\u3068\u30e2\u30d0\u30a4\u30eb\u5411\u3051DB\u3067\u3059\u3002<br \/>\n\u65e2\u5b58\u306e\u30e2\u30d0\u30a4\u30eb\u5411\u3051DB\u3067\u306fSQLite\u304c\u6709\u540d\u3067\u3059\u3002<br \/>\nSQLite\u3067\u306fSQL\u6587\u3092\u30ac\u30ea\u30ac\u30ea\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001Realm\u306fNoSQL\u306a\u306e\u3067SQL\u6587\u3092\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u307e\u305f\u3001\u516c\u5f0f\u30b5\u30a4\u30c8\u66f0\u304f\u3001SQLite\u3088\u308a\u3082\u51e6\u7406\u901f\u5ea6\u304c\u901f\u3044\u3068\u306e\u3053\u3068\u3002<br \/>\n\u6697\u53f7\u5316\u306b\u3082\u5bfe\u5fdc\u3057\u3001Android\u3067\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4fa1\u683c\u3082\u7121\u6599\u3067\u3059\u3002<br \/>\n\u8a73\u3057\u304f\u306f\u3001<a href=\"http:\/\/realm.io\/\">\u516c\u5f0f\u30b5\u30a4\u30c8<\/a>\u3067\u3054\u78ba\u8a8d\u4e0b\u3055\u3044\u3002<br \/>\n<br \/>\niOS\u30a2\u30d7\u30ea\u3067\u3001Realm\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u74b0\u5883\u69cb\u7bc9\u307e\u3067\u3092\u8a18\u8f09\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\n<strong>1.CocoaPods\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\nRealm\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306f\u3001Zip\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u304b\/CocoaPods\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3001CocoaPods\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<br \/>\n<strong>1-1.CocoaPods\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u3066<br \/>\n<pre class=\"lang:default decode:true\">sudo gem install cocoapods<\/pre>\n\u3092\u5b9f\u884c\u3057\u3001CocoaPods\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<br \/>\n<strong>1-2.\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/strong><br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u3001<br \/>\n<pre class=\"lang:default decode:true\">pod setup<\/pre>\n\u3092\u5b9f\u884c\u3057\u3001CocoaPods\u3067\u6271\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u60c5\u5831\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3002<br \/>\n<br \/>\n<strong>2.Realm\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n<strong>2-1.\u30bf\u30fc\u30b2\u30c3\u30c8\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u79fb\u52d5<\/strong><br \/>\nRealm\u3092\u5229\u7528\u3057\u305f\u3044XcodeProject\u30d5\u30a9\u30eb\u30c0\u76f4\u4e0b\u306b\u79fb\u52d5\u3002<br \/>\n<pre class=\"lang:default decode:true\">cd \/***\/RealmSample<\/pre>\n<strong>2-2.Podfile\u3092\u4f5c\u6210<\/strong><br \/>\n<pre class=\"lang:default decode:true\">vi Podfile\nplatform :ios, \u201c8.0\u201d\npod \u2018Realm\u2019<\/pre>\n<strong>2-3.\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u3066<br \/>\n<pre class=\"lang:default decode:true\">pod install<\/pre>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001XcodeProject\u30d5\u30a9\u30eb\u30c0\u76f4\u4e0b\u306bRealmSample.xcworkspace\u3068\u3044\u3046\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u30a2\u30d7\u30ea\u306e\u5b9f\u88c5\u3092\u3059\u308b\u969b\u306f\u3001\u3053\u3061\u3089\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a1\u30a4\u30eb\u304b\u3089Xcode\u3092\u958b\u304f\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<br \/>\n<strong>3.Xcode\u306eplugin\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\nRealm\u306emodel\u4f5c\u6210\u3092\u697d\u306b\u3059\u308b\u305f\u3081\u3001RealmPlugin\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/alcatraz.io\/\">Alcatraz<\/a>\u3068\u3044\u3046Xcode\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u5229\u7528\u3057\u307e\u3059\u3002<br \/>\n<strong>3-1.Alcatraz\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\nAlcatraz\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067<br \/>\n<pre class=\"lang:default decode:true\">curl -fsSL https:\/\/raw.github.com\/supermarin\/Alcatraz\/master\/Scripts\/install.sh | sh<\/pre>\n\u3092\u5b9f\u884c\u3002\uff08<span style=\"color: #ff0000;\">Xcode\u306f\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002<\/span>\uff09<br \/>\n<strong>3-2.Xcode\u306ePackage Manager\u304b\u3089RealmPlugin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n[Xcode] - [Window] - [Package Manager]\u306b\u3066\u201dRealmPlugin\u201d\u3092\u691c\u7d22\u3057\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001[Xcode] - [File] - [New] - [File] - [iOS]\u5185\u306bRealm\u306e\u9078\u629e\u80a2\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<br \/>\n\u4ee5\u4e0a\u3067\u3001\u74b0\u5883\u69cb\u7bc9\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u6b21\u56de\u306f\u3001\u5b9f\u969b\u306e\u4f7f\u3044\u65b9\u7b49\u3092\u6295\u7a3f\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fRealm\u306b\u3064\u3044\u3066\u306e\u3054\u7d39\u4ecb\u3067\u3059\u3002 Realm\u3068\u3044\u3046\u306e\u306f\u3001\u7c21\u5358\u306b\u8a00\u3046\u3068\u30e2\u30d0\u30a4 &hellip; <a href=\"https:\/\/www.key-p.com\/blog\/staff\/archives\/88735\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[],"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/88735"}],"collection":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/comments?post=88735"}],"version-history":[{"count":2,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/88735\/revisions"}],"predecessor-version":[{"id":88737,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/88735\/revisions\/88737"}],"wp:attachment":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/media?parent=88735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/categories?post=88735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/tags?post=88735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}