{"id":192090,"date":"2013-08-31T13:08:03","date_gmt":"2013-08-31T09:08:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=192090"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=192090","title":{"rendered":"<span class=\"post_title\">Pro Core Data for iOS. \u0413\u043b\u0430\u0432\u0430 \u21162. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u0430\u043b\u044e\u0434\u0438, \u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c!<br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u043d\u0430\u0447\u0430\u0442\u044c <b>\u0432\u043e\u043b\u044c\u043d\u044b\u0439<\/b> \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u043d\u0438\u0433\u0438 \u041c\u0438\u0445\u0430\u0435\u043b\u044f \u041f\u0440\u0438\u0432\u0430\u0442\u0430 \u0438 \u0420\u043e\u0431\u0435\u0440\u0442\u0430 \u0412\u0430\u0440\u043d\u0435\u0440\u0430 \u00abPro Core Data for iOS\u00bb, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e <a href=\"http:\/\/it-ebooks.info\/book\/1843\/\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0441\u044b\u043b\u043a\u0435. \u041a\u0430\u0436\u0434\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438 <i>\u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438<\/i> <b>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e<\/b> \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/884\/2d0\/182\/8842d018201f3945800282b64f1d7221.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:  <\/p>\n<ul>\n<li> <a href=\"http:\/\/habrahabr.ru\/post\/191334\/\">\u0413\u043b\u0430\u0432\u0430 \u21161. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c<\/a> (<a href=\"http:\/\/habrahabr.ru\/post\/191472\/\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>) <\/li>\n<li> <a href=\"http:\/\/habrahabr.ru\/post\/191580\/\">\u0413\u043b\u0430\u0432\u0430 \u21162. \u0423\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c Core Data<\/a> (<a href=\"http:\/\/habrahabr.ru\/post\/192090\/\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>)<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21163. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445: SQLite \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21164. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21165. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21166. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21167. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21168. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21169. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c NSFetchedResultsController<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u211610. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Core Data \u0432 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h5>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0411\u0443\u0434\u0435\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c:<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/SzyWgscs.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043c \u0438\u0445. \u0412\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0435\u0449\u0435 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438.<br \/>  \u0413\u043e\u0442\u043e\u0432\u044b? \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h5>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/h5>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u043d\u0430\u0448\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u2014 \u0425\u0430\u0431\u0440\u0430.<br \/>  \u0415\u0441\u0442\u044c N \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:  <\/p>\n<ul>\n<li> \u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u043b\u043e\u0433\u0435 <\/li>\n<li> \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/li>\n<li> \u0422\u0435\u0433\u0438 <\/li>\n<li> \u0425\u0430\u0431\u044b <\/li>\n<li> \u0412\u043e\u043f\u0440\u043e\u0441\u044b <\/li>\n<li> \u041e\u0442\u0432\u0435\u0442\u044b <\/li>\n<li> \u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432?  <\/p>\n<ul>\n<li> \u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u043b\u043e\u0433\u0435 \u2014 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0442\u0435\u043a\u0441\u0442 <\/li>\n<li> \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u2014 \u043d\u0438\u043a, \u043a\u0430\u0440\u043c\u0430, \u0440\u0435\u0439\u0442\u0438\u043d\u0433, \u043f\u043e\u043b, \u0430\u0432\u0430\u0442\u0430\u0440, \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a <\/li>\n<li> \u0422\u0435\u0433 \u2014 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <\/li>\n<li> \u0425\u0430\u0431 \u2014 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u043d\u044b\u0439 \u043b\u0438 \u0445\u0430\u0431 <\/li>\n<li> \u0412\u043e\u043f\u0440\u043e\u0441 \u2014 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0442\u0435\u043a\u0441\u0442<\/li>\n<li> \u041e\u0442\u0432\u0435\u0442 \u2014 \u0442\u0435\u043a\u0441\u0442 <\/li>\n<li> \u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u2014 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0440\u0435\u0439\u0442\u0438\u043d\u0433 <\/li>\n<\/ul>\n<h5>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h5>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c XCode \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 Single View Application:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/963\/4ef\/e2f\/9634efe2f16e68394b73fa3d2769913f.png\"\/><\/p>\n<p>  \u0412\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u0438 \u043f\u0440\u043e\u0447\u0435\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/Y9VPCVC0.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u043d\u0430\u043a\u043e\u043c\u043e\u0435 \u043e\u043a\u043d\u043e:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/k1sGez7T.png\" alt=\"image\"\/><\/p>\n<h5>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Core Data<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Core Data Framework \u0432 \u043f\u0440\u043e\u0435\u043a\u0442:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/A0i5fmR5.png\" alt=\"image\"\/><\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438<\/h5>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b -&gt; iOS -&gt; CoreData -&gt; Data Model<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/aVRN4e7U.png\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/V6g7d3T7.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Blogpost<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>caption<\/i> (String) \u0438 <i>text<\/i> (String).<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/KRBXS5V2.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>User<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <i>avatar<\/i> (String), <i>email<\/i> (String), <i>gender<\/i> (Decimal), <i>karma<\/i> (Integer 16), <i>nickname<\/i> (String), <i>rating<\/i> (Integer 16).<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/3HHcenh4.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Tag<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>name<\/i> (String).<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/FvWUvWCe.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Hab<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>name<\/i> (String), <i>target<\/i> (Boolean).<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/X34tew3v.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Question<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>caption<\/i> (String), <i>text<\/i> (String).<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/xP1Vb3ED.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Response<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0434\u0438\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>text<\/i> (String).<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/Y4Iyw040.png\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0451 <b>Organization<\/b>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>name<\/i> (String), <i>rating<\/i> (Integer 16). <br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/6T6Z88ub.png\" alt=\"image\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/FkseR24h.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<br \/>  \u0423 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (\u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432).<br \/>  \u0423 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0431\u043b\u043e\u0433\u0435, \u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0433\u043e\u0432 \u0438 \u0445\u0430\u0431\u043e\u0432.<br \/>  \u0423 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u0430 \u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u00ab\u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438\u00bb (\u043e\u0434\u0438\u043d-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c) \u00ab\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438\u00bb.<br \/>  \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 <b>Organization<\/b> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 &quot;+&quot; \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Relationships:<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/RpQ9mp5E.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e XCode \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/DFq4lFUy.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e\u043b\u0435 <i>Inverse<\/i> (\u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c) \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u043e\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c, \u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0451 <i>organization<\/i> (\u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0430 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0438\u0433\u0434\u0435, \u0442\u043e \u043f\u043e\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 null):<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/MeT3OCZE.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u043e\u0432\u044c \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <b>Organization<\/b> \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u043b\u0435 <i>Inverse<\/i> \u0432 <i>organization<\/i>:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/NZvRLWUa.png\" alt=\"image\"\/><\/p>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0433\u0440\u0430\u0444:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/3Ta7jyNS.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u044f\u0437\u0438 \u0441\u0430\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0432\u0435\u0440\u044c\u0442\u0435 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<br \/>  \u0412\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u044c, \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0438 \u0441 \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u043d\u0430 \u043e\u0434\u0438\u043d-\u043a\u043e-\u043c\u043d\u043e\u0433\u0438\u043c \u2014 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<br \/>  \u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/s2.ipicture.ru\/uploads\/20130831\/SzyWgscs.png\" alt=\"image\"\/><\/p>\n<h5>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e<\/h5>\n<p>  \u0423\u0436\u0435 \u0438\u043c\u0435\u0435\u043c \u0432 AppDelegate.h \u0442\u0430\u043a\u043e\u0435:  <\/p>\n<pre><code class=\"objectivec\">\/\/ \/\/  TMAppDelegate.h \/\/  Habrahabr \/\/ \/\/  Created by AndrewShmig on 8\/31\/13. \/\/  Copyright (c) 2013 TM. All rights reserved. \/\/  #import &lt;UIKit\/UIKit.h&gt; #import &lt;CoreData\/CoreData.h&gt;  @class TMViewController;  @interface TMAppDelegate : UIResponder &lt;UIApplicationDelegate&gt;  @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) TMViewController *viewController;  @property (nonatomic, strong) NSManagedObjectModel *managedObjectModel; @property (nonatomic, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;  @end <\/code><\/pre>\n<p>  \u0418 \u0432 AppDelegate.m:  <\/p>\n<pre><code class=\"objectivec\">\/\/ \/\/  TMAppDelegate.m \/\/  Habrahabr \/\/ \/\/  Created by AndrewShmig on 8\/31\/13. \/\/  Copyright (c) 2013 TM. All rights reserved. \/\/  #import &quot;TMAppDelegate.h&quot;  @implementation TMAppDelegate  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {     return YES; }  #pragma mark - Core Data Stack  - (NSManagedObjectModel *)managedObjectModel {     if(nil != _managedObjectModel)         return _managedObjectModel;          _managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];          return _managedObjectModel; }  - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {     if(nil != _persistentStoreCoordinator)         return _persistentStoreCoordinator;          NSURL *storeURL = [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory                                                                inDomains:NSUserDomainMask] lastObject] URLByAppendingPathComponent:@&quot;Habrahabr.sqlite&quot;];          NSError *error = nil;     _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];     if(![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]){         NSLog(@&quot;Unresolved error %@, %@&quot;, error, [error userInfo]);         abort();     }          return _persistentStoreCoordinator; }  - (NSManagedObjectContext *)managedObjectContext {     if(nil != _managedObjectContext)         return _managedObjectContext;          NSPersistentStoreCoordinator *store = self.persistentStoreCoordinator;     if(nil != store){         _managedObjectContext = [[NSManagedObjectContext alloc] init];         [_managedObjectContext setPersistentStoreCoordinator:store];     }          return _managedObjectContext; }  @end <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434 application:didFinishLaunchingWithOptions: \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"objectivec\">- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { \/\/    \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e     NSManagedObject *yandex = [NSEntityDescription insertNewObjectForEntityForName:@&quot;Organization&quot;                                                             inManagedObjectContext:self.managedObjectContext];     [yandex setValue:@&quot;Yandex Inc.&quot; forKey:@&quot;name&quot;];     [yandex setValue:@672 forKey:@&quot;rating&quot;];      \/\/    \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 Yandex     NSManagedObject *pupkin = [NSEntityDescription insertNewObjectForEntityForName:@&quot;User&quot;                                                             inManagedObjectContext:self.managedObjectContext];     [pupkin setValue:@&quot;VaseaPup&quot; forKey:@&quot;nickname&quot;];     [pupkin setValue:@&quot;vasilisa@yandex.ru&quot; forKey:@&quot;email&quot;];     [pupkin setValue:@1 forKey:@&quot;gender&quot;]; \/\/ 0 - unknown, 1 - male, 2 - female     [pupkin setValue:@0 forKey:@&quot;karma&quot;];     [pupkin setValue:@0 forKey:@&quot;rating&quot;];          NSManagedObject *gosha = [NSEntityDescription insertNewObjectForEntityForName:@&quot;User&quot;                                                            inManagedObjectContext:self.managedObjectContext];     [gosha setValue:@&quot;Goshka&quot; forKey:@&quot;nickname&quot;];     [gosha setValue:@&quot;gosha.k@yandex.ru&quot; forKey:@&quot;email&quot;];     [gosha setValue:@0 forKey:@&quot;gender&quot;];     [gosha setValue:@0 forKey:@&quot;karma&quot;];     [gosha setValue:@0 forKey:@&quot;rating&quot;];      \/\/    \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0441 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439     NSMutableSet *employees = [yandex mutableSetValueForKey:@&quot;employees&quot;];     [employees addObject:pupkin];     [employees addObject:gosha];      \/\/    \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435     [self saveContext];          NSLog(@&quot;Finish!&quot;);          return YES; } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0431\u044b\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u043e.<br \/>  \u041d\u0430\u0439\u0434\u0435\u043c \u0444\u0430\u0439\u043b Habrahabr.sqlite:<br \/>  <img decoding=\"async\" src=\"http:\/\/s1.ipicture.ru\/uploads\/20130831\/1Wa0NOlG.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414:  <\/p>\n<pre><code class=\"bash\">AndrewShmigs-MacBook-Pro:~ new$ cd &quot;\/Users\/new\/Library\/Application Support\/iPhone Simulator\/6.1\/Applications\/95B0716A-9C2C-4BD8-8117-62FB46BB5879&quot; AndrewShmigs-MacBook-Pro:95B0716A-9C2C-4BD8-8117-62FB46BB5879 new$ ls Documents\tHabrahabr.app\tLibrary\t\ttmp AndrewShmigs-MacBook-Pro:95B0716A-9C2C-4BD8-8117-62FB46BB5879 new$ cd Documents\/ AndrewShmigs-MacBook-Pro:Documents new$ ls Habrahabr.sqlite AndrewShmigs-MacBook-Pro:Documents new$ sqlite3 Habrahabr.sqlite  SQLite version 3.7.12 2012-04-03 19:43:07 Enter &quot;.help&quot; for instructions Enter SQL statements terminated with a &quot;;&quot; sqlite&gt; .schema CREATE TABLE ZBLOGPOST ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZAUTHOR INTEGER, ZCAPTION VARCHAR, ZTEXT VARCHAR ); CREATE TABLE ZHAB ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZTARGET INTEGER, ZBLOGPOSTS INTEGER, ZNAME VARCHAR ); CREATE TABLE ZORGANIZATION ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZRATING INTEGER, ZNAME VARCHAR ); CREATE TABLE ZQUESTION ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZAUTHOR INTEGER, ZCAPTION VARCHAR, ZTEXT VARCHAR ); CREATE TABLE ZRESPONSE ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZQUESTION INTEGER, ZTEXT VARCHAR ); CREATE TABLE ZTAG ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZBLOGPOST INTEGER, ZNAME VARCHAR ); CREATE TABLE ZUSER ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZKARMA INTEGER, ZRATING INTEGER, ZORGANIZATION INTEGER, ZGENDER DECIMAL, ZAVATAR VARCHAR, ZEMAIL VARCHAR, ZNICKNAME VARCHAR ); CREATE TABLE Z_METADATA (Z_VERSION INTEGER PRIMARY KEY, Z_UUID VARCHAR(255), Z_PLIST BLOB); CREATE TABLE Z_PRIMARYKEY (Z_ENT INTEGER PRIMARY KEY, Z_NAME VARCHAR, Z_SUPER INTEGER, Z_MAX INTEGER); CREATE INDEX ZBLOGPOST_ZAUTHOR_INDEX ON ZBLOGPOST (ZAUTHOR); CREATE INDEX ZHAB_ZBLOGPOSTS_INDEX ON ZHAB (ZBLOGPOSTS); CREATE INDEX ZQUESTION_ZAUTHOR_INDEX ON ZQUESTION (ZAUTHOR); CREATE INDEX ZRESPONSE_ZQUESTION_INDEX ON ZRESPONSE (ZQUESTION); CREATE INDEX ZTAG_ZBLOGPOST_INDEX ON ZTAG (ZBLOGPOST); CREATE INDEX ZUSER_ZORGANIZATION_INDEX ON ZUSER (ZORGANIZATION); sqlite&gt; select * from ZORGANIZATION; 1|3|1|672|Yandex Inc. sqlite&gt; select * from ZUSER; 1|7|1|0|0|1|0||gosha.k@yandex.ru|Goshka 2|7|1|0|0|1|1||vasilisa@yandex.ru|VaseaPup sqlite&gt;  <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u043e\u0441\u0442.  <\/p>\n<pre><code class=\"objectivec\">\/\/    \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0443 \u0413\u043e\u0448\u0435 \u0432\u043e\u043f\u0440\u043e\u0441     NSManagedObject *whoAmI = [NSEntityDescription insertNewObjectForEntityForName:@&quot;Question&quot;                                                             inManagedObjectContext:self.managedObjectContext];     [whoAmI setValue:@&quot;Who am I?&quot; forKey:@&quot;caption&quot;];     [whoAmI setValue:@&quot;\u041f\u043e\u043c\u043e\u0433\u0438\u0442\u0435 \u043c\u043d\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u043b\u0443\u0447\u0448\u0435.&quot; forKey:@&quot;text&quot;];          NSMutableSet *goshasQuestions = [gosha mutableSetValueForKey:@&quot;questions&quot;];     [goshasQuestions addObject:whoAmI]; <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0411\u0414:  <\/p>\n<pre><code class=\"bash\">sqlite&gt; select * from ZQUESTION; 1|4|1|4|Who am I?|\u041f\u043e\u043c\u043e\u0433\u0438\u0442\u0435 \u043c\u043d\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u043b\u0443\u0447\u0448\u0435. sqlite&gt;  <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0443 \u0412\u0430\u0441\u0435 \u041f\u0443\u043f\u043a\u0438\u043d\u0443:  <\/p>\n<pre><code class=\"objectivec\">\/\/    \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0443 \u0412\u0430\u0441\u0435 \u041f\u0443\u043f\u043a\u0438\u043d\u0443 \u043d\u043e\u0432\u044b\u0439 \u0431\u043b\u043e\u0433\u043f\u043e\u0441\u0442     NSManagedObject *newPost = [NSEntityDescription insertNewObjectForEntityForName:@&quot;Blogpost&quot;                                                              inManagedObjectContext:self.managedObjectContext];     [newPost setValue:@&quot;yandex.\u0414\u0435\u043d\u044c\u0433\u0438 & yandex.\u041a\u0430\u0440\u0442\u044b & yandex.\u0414\u0432\u0430\u0421\u0442\u0432\u043e\u043b\u0430&quot; forKey:@&quot;caption&quot;];     [newPost setValue:@&quot;Some text&quot; forKey:@&quot;text&quot;];      \/\/    \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0425\u0430\u0431\u0430     NSManagedObject *hab1 = [NSEntityDescription insertNewObjectForEntityForName:@&quot;Hab&quot;                                                           inManagedObjectContext:self.managedObjectContext];     [hab1 setValue:@&quot;iOS&quot; forKey:@&quot;name&quot;];     [hab1 setValue:@YES forKey:@&quot;target&quot;];          NSManagedObject *hab2 = [NSEntityDescription insertNewObjectForEntityForName:@&quot;Hab&quot;                                                           inManagedObjectContext:self.managedObjectContext];     [hab2 setValue:@&quot;Objective-C&quot; forKey:@&quot;name&quot;];     [hab2 setValue:@YES forKey:@&quot;target&quot;];          NSMutableSet *habs = [newPost mutableSetValueForKey:@&quot;habs&quot;];     [habs addObject:hab1];     [habs addObject:hab2];          [[pupkin mutableSetValueForKey:@&quot;blogposts&quot;] addObject:newPost]; <\/code><\/pre>\n<p>  \u0418 \u0432\u044b\u0432\u043e\u0434:  <\/p>\n<pre><code class=\"bash\">sqlite&gt; select * from ZBLOGPOST; 1|1|1|5|yandex.\u0414\u0435\u043d\u044c\u0433\u0438 & yandex.\u041a\u0430\u0440\u0442\u044b & yandex.\u0414\u0432\u0430\u0421\u0442\u0432\u043e\u043b\u0430|Some text sqlite&gt; select * from ZHAB; 1|2|1|1|1|iOS 2|2|1|1|1|Objective-C sqlite&gt;  <\/code><\/pre>\n<h5>\u0412\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445<\/h5>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u0435\u0445 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u041a\u043e\u0434 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0441\u0430\u043b\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<pre><code class=\"objectivec\">    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@&quot;User&quot;];     NSArray *allUsers = [self.managedObjectContext executeFetchRequest:fetchRequest error:nil];          for(NSManagedObject *user in allUsers){         NSString *nickname = [user valueForKey:@&quot;nickname&quot;];         NSString *organization = [user valueForKeyPath:@&quot;organization.name&quot;];                  NSLog(@&quot;%@ works at %@&quot;, nickname, organization);     } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 (\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443 \u043c\u0435\u043d\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b):  <\/p>\n<pre><code class=\"bash\">2013-08-31 13:00:27.255 Habrahabr[18148:c07] Goshka works at Yandex Inc. 2013-08-31 13:00:27.257 Habrahabr[18148:c07] VaseaPup works at Yandex Inc. 2013-08-31 13:00:27.258 Habrahabr[18148:c07] VaseaPup works at Yandex Inc. 2013-08-31 13:00:27.258 Habrahabr[18148:c07] Goshka works at Yandex Inc. 2013-08-31 13:00:27.259 Habrahabr[18148:c07] VaseaPup works at Yandex Inc. 2013-08-31 13:00:27.259 Habrahabr[18148:c07] Goshka works at Yandex Inc. 2013-08-31 13:00:27.260 Habrahabr[18148:c07] Finish! <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u041a\u0430\u043a \u0412\u0430\u043c? \u0410? \u042f \u0442\u0430\u043a \u0438 \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f!<\/p>\n<h5>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435! \u041d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e <a href=\"http:\/\/yadi.sk\/d\/skokMRSh8Wzg0\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0441\u044b\u043b\u043a\u0435.<\/p>\n<p>  \u0423\u0434\u0430\u0447\u0438 \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<br \/>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/192090\/\"> http:\/\/habrahabr.ru\/post\/192090\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u0430\u043b\u044e\u0434\u0438, \u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c!<br \/>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u043d\u0430\u0447\u0430\u0442\u044c <b>\u0432\u043e\u043b\u044c\u043d\u044b\u0439<\/b> \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043a\u043d\u0438\u0433\u0438 \u041c\u0438\u0445\u0430\u0435\u043b\u044f \u041f\u0440\u0438\u0432\u0430\u0442\u0430 \u0438 \u0420\u043e\u0431\u0435\u0440\u0442\u0430 \u0412\u0430\u0440\u043d\u0435\u0440\u0430 \u00abPro Core Data for iOS\u00bb, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e <a href=\"http:\/\/it-ebooks.info\/book\/1843\/\">\u044d\u0442\u043e\u0439<\/a> \u0441\u0441\u044b\u043b\u043a\u0435. \u041a\u0430\u0436\u0434\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438 <i>\u0432\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438<\/i> <b>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e<\/b> \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/884\/2d0\/182\/8842d018201f3945800282b64f1d7221.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:  <\/p>\n<ul>\n<li> <a href=\"http:\/\/habrahabr.ru\/post\/191334\/\">\u0413\u043b\u0430\u0432\u0430 \u21161. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c<\/a> (<a href=\"http:\/\/habrahabr.ru\/post\/191472\/\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>) <\/li>\n<li> <a href=\"http:\/\/habrahabr.ru\/post\/191580\/\">\u0413\u043b\u0430\u0432\u0430 \u21162. \u0423\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c Core Data<\/a> (<a href=\"http:\/\/habrahabr.ru\/post\/192090\/\">\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/a>)<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21163. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445: SQLite \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21164. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21165. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21166. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21167. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21168. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u21169. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c NSFetchedResultsController<\/li>\n<li> \u0413\u043b\u0430\u0432\u0430 \u211610. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Core Data \u0432 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445<\/li>\n<\/ul>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-192090","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192090"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192090\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}