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.

Next in Cocoa
Your most important breakpoint in Cocoa

Leave a Reply

avatar
500
  Subscribe  
Notify of

(c) 2008-2019 Corbin Dunn

Privacy Policy

Subscribe to RSS feeds for entries.

84 queries. 0.218 seconds.

Log in