views:

85

answers:

2

I have an NSWindow that shows up when you click either of two items (both from an NSTableView). I have a setter method that tells the window what information to display. This all works perfectly, until it comes time to display the data in the window. If I cause the window to display from one tableview, then try to have it display the new data from another it doesn't do it, it keeps the old data on.

I am using the exact same method to get and display the data from both possible ways to have the window show up, and the data is changing correctly. To display the window I'm using [mywindow makeKeyAndOrderFront:self];

and one table view is in the same class as the window, while the other one isn't

A: 

Have you tried calling [[mywindow contentView] setNeedsDisplay:YES]; after your makeKeyAndOrderFront: call?

Isaac
yea, but it didn't work
Matt S.
Which table view works and which one does not? If the table view that is in a different class from the window is the one that does not work, there's probably an issue with how the classes are connected. In either case, it would help to see more code.
Isaac
there isn't really any more code to see. I tell the window what data to display and it does. It works fine if I set it the data in the same class, but if it's from a different, the data gets to the method that inserts the data, and it appears to get inserted, but the window doesn't show it
Matt S.
Are you sure that `mywindow` properly points to the window in the other class? I assume that you know the data is getting to the method that inserts the data because you are logging from somewhere in that method.
Isaac
@Matt S: Sorry, but there must be more code. How do your table views inform the window with the data in that they have changed, for instance?
JeremyP
@JeremyP I have a method that takes the info from the selected row then takes that string value and sends it off to the method that sets all the textfield values.@Isaac the window's data is all handled by one class. I have a method that sets the data, which gets called by any class I desire
Matt S.
A: 

It turns out I was silly and not calling [myWindow showWindow:self];

Matt S.
That has nothing to do with updating the data displayed in any views in the window. It isn't even an NSWindow method; it's an NSWindowController method.
Peter Hosey