{"id":1538,"date":"2012-12-23T01:52:38","date_gmt":"2012-12-22T16:52:38","guid":{"rendered":"http:\/\/redwing.moo.jp\/cocoa\/?p=1538"},"modified":"2012-12-23T01:59:23","modified_gmt":"2012-12-22T16:59:23","slug":"interface-builder-%e3%81%a7-tableview-%e3%81%a8-cell-%e3%82%92%e9%96%a2%e9%80%a3%e3%81%a5%e3%81%91%e3%82%8b%e6%89%8b%e9%a0%86","status":"publish","type":"post","link":"https:\/\/redwing.moo.jp\/cocoa\/archives\/1538","title":{"rendered":"Interface Builder \u3067 TableView \u3068 Cell \u3092\u95a2\u9023\u3065\u3051\u308b\u624b\u9806"},"content":{"rendered":"<p>\u57fa\u672c\u7684\u306b Interface Builder \u306f\u4f7f\u308f\u306a\u3044\u6d3e\u306a\u306e\u3067\u3059\u304c\u3001\u5148\u65e5\u5fc5\u8981\u306b\u8feb\u3089\u308c\u3066\u5229\u7528\u3057\u305f\u969b\u306b TableView \u3068 Cell \u3092\u95a2\u9023\u3065\u3051\u308b\u306e\u306b\u82e6\u52b4\u3057\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002<\/p>\n<p><strong>1. Interface Builder \u3067 TableView \u3092\u30d3\u30e5\u30fc\u306b\u8cbc\u308a\u4ed8\u3051\u308b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/dcdd0b3167902cffbe1ec055c3f6b75b.png\" alt=\"1_Interface Builder \u3067 TableView \u3092\u30d3\u30e5\u30fc\u306b\u8cbc\u308a\u4ed8\u3051\u308b\" width=\"560\" height=\"380\" class=\"aligncenter size-full wp-image-1547\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/dcdd0b3167902cffbe1ec055c3f6b75b.png 560w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/dcdd0b3167902cffbe1ec055c3f6b75b-300x203.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p><strong>2. Interface Builder \u306e\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u304b\u3089\u53f3\u30de\u30a6\u30b9\u30af\u30ea\u30c3\u30af\u3067\u30d8\u30c3\u30c0\u306b IBOutlet \u5ba3\u8a00\u3092\u4f5c\u6210\u3059\u308b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/c09912e87b1474e810d063361f17bdd3.png\" alt=\"2_Interface Builder \u306e\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u304b\u3089\u53f3\u30de\u30a6\u30b9\u30af\u30ea\u30c3\u30af\u3067\u30d8\u30c3\u30c0\u306b IBOutlet \u5ba3\u8a00\u3092\u4f5c\u6210\u3059\u308b\" width=\"560\" height=\"380\" class=\"aligncenter size-full wp-image-1548\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/c09912e87b1474e810d063361f17bdd3.png 560w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/c09912e87b1474e810d063361f17bdd3-300x203.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/e636896b1b314fd5f5c350bc0611fca2.png\" alt=\"3_Interface Builder \u306e\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u304b\u3089\u53f3\u30de\u30a6\u30b9\u30af\u30ea\u30c3\u30af\u3067\u30d8\u30c3\u30c0\u306b IBOutlet \u5ba3\u8a00\u3092\u4f5c\u6210\u3059\u308b\" width=\"606\" height=\"427\" class=\"aligncenter size-full wp-image-1549\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/e636896b1b314fd5f5c350bc0611fca2.png 606w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/e636896b1b314fd5f5c350bc0611fca2-300x211.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/p>\n<p><strong>3. Interface Builder \u3067 Empty &#8211; .xib \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u30bb\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/d752292681c905602bc6474b26b169a3.png\" alt=\"4_Interface Builder \u3067 Empty - .xib \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u30bb\u30eb\u3092\u4f5c\u6210\u3059\u308b\" width=\"606\" height=\"427\" class=\"aligncenter size-full wp-image-1550\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/d752292681c905602bc6474b26b169a3.png 606w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/d752292681c905602bc6474b26b169a3-300x211.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/p>\n<p><strong>4. Interface Builder \u3067\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc \u30bb\u30eb\u306e&#8221;Custom Class &#8211; Class&#8221;\u3092\u81ea\u30af\u30e9\u30b9\u540d\u3092\u8a2d\u5b9a\u3059\u308b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/f6b5ee05de5f08e26cd619cbfe94a1c4.png\" alt=\"5_Interface-Builder-\u3067\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc-\u30bb\u30eb\u306e&#039;Custom-Class---Class&#039;\u3092\u81ea\u30af\u30e9\u30b9\u540d\u3092\u8a2d\u5b9a\u3059\u308b\" width=\"600\" height=\"400\" class=\"aligncenter size-full wp-image-1568\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/f6b5ee05de5f08e26cd619cbfe94a1c4.png 600w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/f6b5ee05de5f08e26cd619cbfe94a1c4-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>5. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e&#8221;datasource&#8221;\u3092&#8221;File&#8217;s Owner&#8221;\u306b\u8a2d\u5b9a\u3059\u308b<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/28c2884a566bc18e494dbc48025ab65c.png\" alt=\"6_\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e%22datasource%22\u3092%22File&#039;s Owner%22\u306b\u8a2d\u5b9a\u3059\u308b\" width=\"560\" height=\"380\" class=\"aligncenter size-full wp-image-1552\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/28c2884a566bc18e494dbc48025ab65c.png 560w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/28c2884a566bc18e494dbc48025ab65c-300x203.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p><strong>6. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306b\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u914d\u5217\u3092\u4f5c\u6210\u3059\u308b<\/strong><br \/>\n<strong>7. \u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc\u306e\u30bb\u30eb \u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b<\/strong><br \/>\n<strong>8. Interface Builder \u3067\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc \u30bb\u30eb\u306e&#8221;Table View Cell &#8211; Identifier&#8221;\u3092\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3068\u540c\u3058\u306b\u8a2d\u5b9a\u3059\u308b<\/strong><\/p>\n<pre lang=\"objc\" line=\"1\">\r\n- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath\r\n{\r\n    static NSString* identifier = @\"TableViewCell\";\r\n\r\n    TableViewCell* cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:identifier];\r\n    if (nil == cell) {\r\n        cell = (TableViewCell *)[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault\r\n                                                       reuseIdentifier:identifier];\r\n        \/\/ \u30ea\u30bd\u30fc\u30b9\u304c NSArray \u3067\u53d6\u5f97\u3055\u308c\u308b\r\n        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@\"TableViewCell\" owner:nil options:nil];\r\n        for (id oneObject in nib) {\r\n            if ([oneObject isKindOfClass:[UITableViewCell class]]) {\r\n                cell = (TableViewCell *)oneObject;\r\n                break;\r\n            }\r\n        }\r\n<\/pre>\n<p>\u30ea\u30bd\u30fc\u30b9\u304c NSArray \u3067\u8fd4\u3055\u308c\u308b\u306e\u3067\u30af\u30e9\u30b9\u3092\u5224\u5b9a\u3057\u3066\u9069\u5207\u306a\u30ea\u30bd\u30fc\u30b9\u3092\u9069\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\u3002<br \/>\n\u4e00\u3064\u306e.xib \u30d5\u30a1\u30a4\u30eb\u306b\u8907\u6570\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3067\u304d\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u624b\u9806\u306b\u306a\u308b\u3093\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/1be30b4488abe465cec6ce6ab92f6094.png\" alt=\"7_Interface-Builder-\u3067\u30c6\u30fc\u30d6\u30eb\u30d3\u30e5\u30fc-\u30bb\u30eb\u306e&#039;Table-View-Cell---Identifier&#039;\u3092\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3068\u540c\u3058\u306b\u8a2d\u5b9a\u3059\u308b\" width=\"600\" height=\"400\" class=\"aligncenter size-full wp-image-1569\" srcset=\"https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/1be30b4488abe465cec6ce6ab92f6094.png 600w, https:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/1be30b4488abe465cec6ce6ab92f6094-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4>\u6ce8\u610f\u70b9<\/h4>\n<p>1. .xib \u3068 \u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304c\u7d10\u4ed8\u3051\u3089\u308c\u306a\u3044\u5834\u5408\u3001File&#8217;s Owner \u306e\u30af\u30e9\u30b9\u540d\u8a2d\u5b9a\u304c\u5408\u81f4\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u304c\u3042\u308b<\/p>\n<p>2. this class is not key value coding-compliant for the key<br \/>\n\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u3001Interface Builder \u306e\u8a2d\u5b9a\u306b\u554f\u984c\u304c\u3042\u308b<br \/>\n\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8ffd\u52a0\u3001\u524a\u9664\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u308b\u3068\u3001\u4e0d\u8981\u306a\u8a2d\u5b9a\u304c\u6b8b\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<p>\u6b63\u76f4\u3001Interface Builder \u306f\u30d7\u30ed\u30b0\u30e9\u30de\u306b\u3068\u3063\u3066\u3042\u307e\u308a\u30e1\u30ea\u30c3\u30c8\u304c\u611f\u3058\u3089\u308c\u306a\u3044\u3002<br \/>\n\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u306f\u300c\u30e2\u30c3\u30af\u3092\u65e9\u304f\u4f5c\u308b\u300d\u3068\u304b\u300c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u914d\u7f6e\u3059\u308b\u969b\u306e\u5ea7\u6a19\u3092\u8abf\u3079\u3089\u308c\u308b\u300d\u7a0b\u5ea6\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u8a2d\u5b9a\u306a\u3069\u306f\u30b3\u30fc\u30c9\u3067\u884c\u3063\u305f\u65b9\u304c\u3042\u3068\u3067\u691c\u7d22\u306a\u3069\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3084\u3059\u304b\u3063\u305f\u308a\u3001\u751f\u6210\u51e6\u7406\u3092\u7d71\u4e00\u3067\u304d\u305f\u308a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u3046\u3044\u3046\u30c4\u30fc\u30eb\u3063\u3066\u4e00\u898b\u4fbf\u5229\u305d\u3046\u306b\u898b\u3048\u3066\u5b9f\u306f\u4fbf\u5229\u3058\u3083\u306a\u3044\u3063\u3066\u611f\u3058\u306a\u3093\u3067\u3059\u3088\u306d\u3002<br \/>\n\u4e00\u5fdc\u3001\u4eca\u98a8\u3092\u77e5\u3063\u3066\u304a\u304f\u3068\u3044\u3046\u3053\u3068\u3067\u89e6\u3063\u305f\u304c\u3001\u3053\u3046\u3044\u3046\u306e\u3092\u62b5\u6297\u611f\u306a\u304f\u591a\u7528\u3067\u304d\u308b\u30bf\u30a4\u30d7\u3067\u306f\u306a\u3044\u3067\u3059\u3002(>_<)\n\u9069\u6750\u9069\u6240\u3063\u3066\u3084\u3064\u304c\u91cd\u8981\u3067\u3059\u3088\u306d\u3002\n\n\n<\/p>\n<a href=\"https:\/\/twitter.com\/redwing1300?ref_src=twsrc%5Etfw\" class=\"twitter-follow-button\" data-size=\"large\" data-show-count=\"false\">Follow @redwing1300<\/a><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><div id=\"redwi-1385121421\" class=\"redwi- redwi-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9652476346722993\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-9652476346722993\" \ndata-ad-slot=\"\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u57fa\u672c\u7684\u306b Interface Builder \u306f\u4f7f\u308f\u306a\u3044\u6d3e\u306a\u306e\u3067\u3059\u304c\u3001\u5148\u65e5\u5fc5\u8981\u306b\u8feb\u3089\u308c\u3066\u5229\u7528\u3057\u305f\u969b\u306b TableView \u3068 Cell \u3092\u95a2\u9023\u3065\u3051\u308b\u306e\u306b\u82e6\u52b4\u3057\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002 1. Interface Builder &hellip; <a href=\"https:\/\/redwing.moo.jp\/cocoa\/archives\/1538\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,4],"tags":[64,14,65],"class_list":["post-1538","post","type-post","status-publish","format-standard","hentry","category-ios","category-xcode4","tag-interfacebuilder","tag-uitableview","tag-uitableviewcell"],"_links":{"self":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/comments?post=1538"}],"version-history":[{"count":39,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1538\/revisions"}],"predecessor-version":[{"id":1593,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1538\/revisions\/1593"}],"wp:attachment":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/media?parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/categories?post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/tags?post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}