开发者

Cocoa NSWindow not updating with data

开发者 https://www.devze.com 2022-12-31 03:49 出处:网络
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

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 win开发者_运维问答dow 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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消