Cocoa: Disappearing headers in CoreData generated TableViews

Apple, Cocoa, General

Apple Cocoa developers: Finally another blog entry for you!
Everyone else: You may want to skip this one…

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:

Core Data Tableview2

you will sometimes see the header disappear:

Core Data Tableview2A

Looking at the NSTableView in IB reveals that it has an offset frame location, which you cannot change:

Core Data Tableview Inib

The solution is to add an outlet to the NSTableView inside your controller and add a bit of code to correct the situation:

- (void)awakeFromNib {
   [tableView setFrameOrigin:NSZeroPoint];

This relates to MacOS 10.4 Tiger.

Previous Post
Barbara Butler's Treehouses and Play Structures
Next Post
Cocoa: Using NSPredicate and NSMetadataQuery

Leave a Reply

Notify of

As an Amazon Associate I earn from qualifying purchases.

(c) 2008-2020 Corbin Dunn

Privacy Policy

Subscribe to RSS feeds for entries.

67 queries. 0.434 seconds.

Log in