开发者

migrate cocoa touch project to cocoa

开发者 https://www.devze.com 2023-02-03 15:26 出处:网络
I used the codes below to access the variable in the project appDelegate =(AppDelegate *)[[UIApplication sharedApplication]开发者_JS百科 delegate];

I used the codes below to access the variable in the project

appDelegate =(AppDelegate *)[[UIApplication sharedApplication]开发者_JS百科 delegate];
UIApplication *app=[UIApplication sharedApplication];
appDelegate.myInt=1;

It works.

But when I try to migrate the project to Cocoa, I found there is no way to do the same functions as above. How can I use delegate concept to access the global variables (not use 'extern NSInteger myInt')

Welcome any comment

Thanks

interdev


Have a look at the NSApplication class documentation

0

精彩评论

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