开发者

Cocoa objective-c, is there an equivalent to PHP sessions?

开发者 https://www.devze.com 2023-02-10 22:30 出处:网络
My app lets the user create multiple custom views by clicking a button (the views are simple circles). When they mouseDown on the circle I send a message to the NotificationCenter and run Core Animati

My app lets the user create multiple custom views by clicking a button (the views are simple circles). When they mouseDown on the circle I send a message to the NotificationCenter and run Core Animation to make the view pulse (fade in and out). I also set NSView *activeView to the view passed to the NotificationCenter.

In the background of these user created views is a custom view named gameMap. If a user 开发者_StackOverflow中文版clicks outside of one of the circles then gameMap sends a message to the NotificationCenter.

What should happen here is the activeView (circle) should move to the mouse click point. But because the NotificationCenter is in my AppController class, if it is being notified of a click outside of a circle view it doesn't have an activeView to reference.

I need a way to store, independent of classes, the activeView. In PHP I would just use a $_SESSION['activeView'] = $thisView, or something similar. Can I do something like this in cocoa?

0

精彩评论

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