{"id":109,"date":"2006-01-05T09:00:56","date_gmt":"2006-01-05T17:00:56","guid":{"rendered":"http:\/\/www.corbinstreehouse.com\/blog\/?p=109"},"modified":"2018-10-31T10:15:16","modified_gmt":"2018-10-31T17:15:16","slug":"cocoa-disappearing-headers-in-coredata-generated-tableviews","status":"publish","type":"post","link":"https:\/\/www.corbinstreehouse.com\/blog\/2006\/01\/cocoa-disappearing-headers-in-coredata-generated-tableviews\/","title":{"rendered":"Cocoa: Disappearing headers in CoreData generated TableViews"},"content":{"rendered":"<p id=\"top\" \/>Apple Cocoa developers: Finally another blog entry for you!<br \/>\nEveryone else: You may want to skip this one&#8230;<\/p>\n<p>It has come to my attention that some NSTableView instances created by dragging CoreData objects into Interface Builder will not work quite right. Specifically, if you add one more row from a case like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/Core_data_tableview2.png\" height=\"219\" width=\"411\" border=\"1\" hspace=\"4\" vspace=\"4\" alt=\"Core Data Tableview2\" \/><\/p>\n<p>you will sometimes see the header disappear:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/Core_data_tableview2a.png\" height=\"223\" width=\"413\" border=\"1\" hspace=\"4\" vspace=\"4\" alt=\"Core Data Tableview2A\" \/><\/p>\n<p>Looking at the NSTableView in IB reveals that it has an offset frame location, which you cannot change:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/Core_data_tableview_inIB.png\" height=\"486\" width=\"306\" border=\"1\" hspace=\"4\" vspace=\"4\" alt=\"Core Data Tableview Inib\" \/><\/p>\n<p>The solution is to add an outlet to the NSTableView inside your controller and add a bit of code to correct the situation:<\/p>\n<pre><tt>- (void)awakeFromNib {\n   [tableView setFrameOrigin:NSZeroPoint];\n}<\/tt><\/pre>\n<p>This relates to MacOS 10.4 Tiger.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apple Cocoa developers: Finally another blog entry for you! Everyone else: You may want to skip this one&#8230; It has come to my attention that some NSTableView instances created by dragging CoreData objects into Interface&#8230; <a class=\"read-more\" href=\"https:\/\/www.corbinstreehouse.com\/blog\/2006\/01\/cocoa-disappearing-headers-in-coredata-generated-tableviews\/\">[read more]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4,6,1],"tags":[63,130,72],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-apple","category-cocoa","category-general","tag-cocoa","tag-objc","tag-programming"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p8zn47-1L","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":5329,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions\/5329"}],"wp:attachment":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}