开发者

Global object sharing between 2 views

I have created a project using Utility Application. It creates 2 views, one mai开发者_如何学JAVAn and one flipview. How can i declare a global variable in main so that i can access it in flipview controller too?


If I recall correctly, the flipside view controller is created by the main view controller in the Utility template. If these are the only view controllers you use in your app, you can easily pass data to and from the flipside view controller by adding properties and/or init methods.

However, if you must use a global variable, here's an article that discusses the various methods:

Cocoa with Love: Singletons, AppDelegates and top-level data.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜