How can I make an NSTableView update its display on command?

2009-12-26 Thread Daniel Wambold
Hello List,
I am writing a CoreData app with an entity controller bound to an NSTableView, 
with the bindings created programmatically. Periodically, the program creates a 
new NSManagedObject, sets default values, and adds it to the MOC. This works 
fine. However, the NSTableView does not update its display until I mouse over 
it. In a given period of time, several objects may have been added, but they do 
not appear until the pointer enters the NSTableView onscreen. I have tried each 
of the following, then commented them out when they failed:

NSLog (@Have we updated yet?\n);

// 1 // [myTableViewOutlet reloadData];

// 2 // [myTableViewOutlet lockFocus];
//  [myTableViewOutlet display];
//  [myTableViewOutlet unlockFocus];

// 3 // [myTableViewOutlet viewWillDraw];

// 4 // [myTableViewOutlet lockFocus];
[myTableViewOutlet drawRect:[myTableViewOutlet bounds]];
[myTableViewOutlet unlockFocus];

// 5 // [[myTableViewOutlet superview] setNeedsDisplay:YES];

// 6 // [myTableViewOutlet lockFocus];
//  NSRect myTableViewNewRowRect = [myTableViewOutlet 
rectOfRow:([myTableViewOutlet numberOfRows]-1)];
//  [myTableViewOutlet drawRow:([myTableViewOutlet numberOfRows]-1) 
clipRect:myTableViewNewRowRect];
//  [myTableViewOutlet unlockFocus];

// 7 // [myTableViewOutlet scrollRowToVisible:([myTableViewOutlet 
numberOfRows]-1)];

Any hints on how to make this view update itself on command. I realize its 
deferred updating is probably the result of the runtime trying to be efficient, 
but these new object events only occur about once every 5 minutes, and the end 
user is not going to understand why none appear for a while, then a whole bunch 
suddenly pop into view when they move the mouse.

Thanks!
-Dan___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: How can I make an NSTableView update its display on command?

2009-12-26 Thread Daniel Wambold
Sorry. It was NOT the NSTableView's problem. I neglected to add:

[[self managedObjectContext] processPendingChanges];

after the NSManagedObject was created. Please disregard the previous post.

Best Regards,
Dan
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com