开发者

Communicate with NSView from another class

开发者 https://www.devze.com 2023-02-12 01:19 出处:网络
I have an NSView thats used as a status item and I need to run this on/in it: thingOne = NO; [self setNeedsDisplay:YES];

I have an NSView thats used as a status item and I need to run this on/in it:

thingOne = NO;
[self setNeedsDisplay:YES];

but can't figure out how. I tried sending a notification (form another notification a class gets) but the notifications never received. I also tried to add a method to do this but it requires using a + symbol for it and I can't access the classes variables. How can this be done? (If it's even possible)

开发者_StackOverflow社区Thanks for any help


I was able to send the notification to the app delegate. Then I added a method to the view object to change the bool and had the notification call it.

0

精彩评论

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

关注公众号